Documentation
¶
Overview ¶
Package email verifies email ownership and sends one-time codes over SMTP.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Verified ¶ added in v3.1.0
func Verified(cfg *config.EmailConfig, providerVerified, localVerified bool) bool
Verified reports whether an upstream email is verified enough for the configured verification mode. providerVerified is the provider's email_verified assertion; localVerified reports whether the same connector account previously verified the email with a one-time code. When it returns false, sign-in must send a one-time code or deny the user, and refresh revokes the grant. A nil cfg, from an omitted email block, uses the default mode.
Types ¶
type Credentials ¶
Credentials contains SMTP authentication credentials.
func ParseCredentials ¶
func ParseCredentials(raw string) (Credentials, error)
ParseCredentials parses and validates JSON-encoded SMTP credentials.
type OTPMailer ¶
type OTPMailer struct {
// contains filtered or unexported fields
}
OTPMailer renders and sends one-time verification code messages.
func NewOTPMailer ¶
NewOTPMailer creates an SMTP-backed one-time code mailer.
type SMTPMailer ¶
type SMTPMailer struct {
// contains filtered or unexported fields
}
SMTPMailer sends multipart messages over SMTP.
func NewSMTPMailer ¶
func NewSMTPMailer(config config.SMTPConfig, credentials Credentials) *SMTPMailer
NewSMTPMailer creates an SMTP transport.