emailverification

package
v1.6.9 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

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

func GenerateToken() (rawToken, tokenHash string, err error)

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.

Jump to

Keyboard shortcuts

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