verification

package
v1.15.23 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrVerificationCodeInvalid      = errors.New("verification code is invalid or expired")
	ErrVerificationAttemptsExceeded = errors.New("verification code attempt limit exceeded")
)

Functions

func DeleteVerificationCode

func DeleteVerificationCode(ctx context.Context, client *redis.Client, cacheKey string) error

func SaveVerificationCode

func SaveVerificationCode(ctx context.Context, client *redis.Client, cacheKey, code string, expiration time.Duration) error

func ValidateVerificationCode

func ValidateVerificationCode(ctx context.Context, client *redis.Client, cacheKey, supplied string, consume bool) error

ValidateVerificationCode rate-limits guesses and optionally consumes a correct code atomically. A registration or account mutation must consume it; a UI pre-check may validate without consuming it.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL