Documentation
¶
Index ¶
- func CreateMfaChallenge(challenge MfaChallenge) error
- func GenerateEmailOTP() (string, error)
- func GenerateTotpSecret(username, issuer string) (secret string, otpauthURL string, err error)
- func HandleMfa(w http.ResponseWriter, r *http.Request)
- func IncrementFailedAttempts(id string) error
- func MarkChallengeUsed(id string) error
- func SendEmailOTP(to, code string) error
- func SendPasswordResetEmail(to, resetURL string) error
- func SendTestEmail(to string) error
- func SendVerificationEmail(to, verifyURL string) error
- func UpdateChallengeCode(id, code string) error
- func ValidateTotpCode(secret, code string) bool
- type LoginState
- type MfaChallenge
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateMfaChallenge ¶
func CreateMfaChallenge(challenge MfaChallenge) error
func GenerateEmailOTP ¶
func GenerateTotpSecret ¶
func HandleMfa ¶
func HandleMfa(w http.ResponseWriter, r *http.Request)
HandleMfa handles multi-factor authentication requests. CSRF-protected form — not included in public API docs.
Methods: GET, POST Route: /oauth2/mfa Accept: x-www-form-urlencoded Produce: html Param challenge_id query string false "MFA challenge ID (GET)" Param challenge_id formData string false "MFA challenge ID (POST)" Param code formData string false "Verification code (POST)" Param totp_secret formData string false "TOTP secret for enrollment (POST)" Param trust_device formData string false "Whether to trust the device (POST)" Success 200 "MFA form (GET)" Success 302 "Redirect back to client with code after success (POST)"
func IncrementFailedAttempts ¶ added in v1.4.0
func MarkChallengeUsed ¶
func SendEmailOTP ¶
func SendPasswordResetEmail ¶ added in v1.6.0
func SendTestEmail ¶ added in v1.5.8
func SendVerificationEmail ¶ added in v1.5.8
func UpdateChallengeCode ¶
func ValidateTotpCode ¶
Types ¶
type LoginState ¶
Click to show internal directories.
Click to hide internal directories.