Documentation
¶
Index ¶
- Variables
- func DeleteVerificationCode(ctx context.Context, client *redis.Client, cacheKey string) error
- func SaveVerificationCode(ctx context.Context, client *redis.Client, cacheKey, code string, ...) error
- func ValidateVerificationCode(ctx context.Context, client *redis.Client, cacheKey, supplied string, ...) error
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 SaveVerificationCode ¶
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.
Click to show internal directories.
Click to hide internal directories.