Documentation
¶
Index ¶
- func BuildVerifyURL(rawToken string, p OAuthParams) string
- func GenerateToken() (rawToken, tokenHash string, err error)
- func HandleResendVerification(w http.ResponseWriter, r *http.Request)
- func HandleVerifyEmail(w http.ResponseWriter, r *http.Request)
- func RenderVerifyEmail(w http.ResponseWriter, r *http.Request, mode, username string, ...)
- type OAuthParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildVerifyURL ¶
func BuildVerifyURL(rawToken string, p OAuthParams) string
BuildVerifyURL constructs the full verification link to embed in the email.
func GenerateToken ¶
GenerateToken returns a URL-safe random token and its SHA-256 hash.
func HandleResendVerification ¶
func HandleResendVerification(w http.ResponseWriter, r *http.Request)
HandleResendVerification handles POST /oauth2/resend-verification
func HandleVerifyEmail ¶
func HandleVerifyEmail(w http.ResponseWriter, r *http.Request)
HandleVerifyEmail handles GET /oauth2/verify-email?token=...&<oauth params>
func RenderVerifyEmail ¶
func RenderVerifyEmail(w http.ResponseWriter, r *http.Request, mode, username string, params OAuthParams, errMsg string)
RenderVerifyEmail renders the verify_email template. mode: "sent" (after signup/resend), "blocked" (login attempt), "expired" (stale link).
Types ¶
type OAuthParams ¶
type OAuthParams struct {
RedirectURI string
State string
ClientID string
Scope string
Nonce string
CodeChallenge string
CodeChallengeMethod string
AuthorizeSig string
}
OAuthParams holds the OAuth2 authorization request parameters needed to resume the flow after email verification.
Click to show internal directories.
Click to hide internal directories.