Documentation
¶
Overview ¶
Package email defines the provider-independent email boundary of Auth-All. The application owns delivery. Auth-All supplies intent and required data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Intent ¶
type Intent string
Intent identifies why Auth-All asks the application to send a message.
const ( IntentVerifyEmail Intent = "verify-email" IntentResetPassword Intent = "reset-password" IntentMagicLink Intent = "magic-link" // IntentEmailChange asks the application to send a confirmation to the new // address of a user. The message carries the token. IntentEmailChange Intent = "email-change" // IntentEmailChangeNotice asks the application to tell the old address of a // user that somebody asked for a change. The message carries no token and // no link, so the old address cannot complete the change. IntentEmailChangeNotice Intent = "email-change-notice" // IntentDeleteAccount asks the application to send a confirmation of an // account delete. A user with no password credential needs it. IntentDeleteAccount Intent = "delete-account" )
Required v1 intents.
type Message ¶
type Message struct {
// Intent describes the purpose of the message.
Intent Intent
// To is the destination email address.
To string
// UserID is the target user. It is empty when no user exists yet.
UserID string
// Token is the one-time token in plaintext. It exists only here and in the
// delivered message. Auth-All stores only its hash.
Token string
// URL is the ready-to-use action link.
URL string
// ExpiresAt is the token expiry.
ExpiresAt time.Time
// Data carries additional intent-specific values.
Data map[string]string
}
Message is the data Auth-All supplies for one message.
Click to show internal directories.
Click to hide internal directories.