Type Alias: EmailAuthOptions
EmailAuthOptions =
object
Defined in: auth-core/src/emailAuthTypes.ts:305
Properties
baseUrl?
optionalbaseUrl?:string
Defined in: auth-core/src/emailAuthTypes.ts:329
Absolute base URL of the application the emailed links point at, e.g.
https://app.example.com. Required by every mode except emailCode.
emailCode?
optionalemailCode?:EmailCodeOptions
Defined in: auth-core/src/emailAuthTypes.ts:341
hooks?
optionalhooks?:EmailAuthHooks
Defined in: auth-core/src/emailAuthTypes.ts:344
issueSession
issueSession: (
user) =>Promise<EmailAuthSession> |EmailAuthSession
Defined in: auth-core/src/emailAuthTypes.ts:316
Mints whatever the application calls a session. Kept as a hook rather than a built-in because session topology is the one thing consumers genuinely disagree on — a long-lived JWT and a short access token with a rotating refresh family are both valid, and neither belongs in this engine.
Parameters
| Parameter | Type |
|---|---|
user | EmailAuthUser |
Returns
Promise<EmailAuthSession> | EmailAuthSession
linkPaths?
optionallinkPaths?:object
Defined in: auth-core/src/emailAuthTypes.ts:335
Client-side paths the emailed links land on, appended to baseUrl with
?token=. Default to /auth/callback, /auth/verify-email and
/auth/reset-password.
emailVerification?
optionalemailVerification?:string
magicLink?
optionalmagicLink?:string
passwordReset?
optionalpasswordReset?:string
modes
modes:
EmailAuthMode[]
Defined in: auth-core/src/emailAuthTypes.ts:307
The flows to enable. At least one is required.
oneTimeTokenStore
oneTimeTokenStore:
OneTimeTokenStore
Defined in: auth-core/src/emailAuthTypes.ts:309
password?
optionalpassword?:PasswordOptions
Defined in: auth-core/src/emailAuthTypes.ts:342
paths?
optionalpaths?:EmailAuthPaths
Defined in: auth-core/src/emailAuthTypes.ts:343
requestRateLimit?
optionalrequestRateLimit?:RequestRateLimit
Defined in: auth-core/src/emailAuthTypes.ts:355
Caps how often one address can be mailed. Strongly recommended: without it the send endpoints will mail any address as fast as they are called.
The cap is applied to the request, before the engine looks the address up,
and every request is recorded whether or not mail followed. That is
deliberate — counting only the requests that produced mail would make a
429 mean "this address has an account", turning the limiter into the
enumeration oracle the rest of the flow is careful to avoid.
sendEmail
sendEmail: (
delivery) =>Promise<void> |void
Defined in: auth-core/src/emailAuthTypes.ts:324
Sends one auth email. Anything it throws propagates out of the handler to the adapter's error handling rather than being folded into a response, so a delivery outage surfaces as an error the application already reports.
Parameters
| Parameter | Type |
|---|---|
delivery | EmailAuthDelivery |
Returns
Promise<void> | void
ttl?
optionalttl?:EmailAuthTtl
Defined in: auth-core/src/emailAuthTypes.ts:340
userStore
userStore:
EmailAuthUserStore
Defined in: auth-core/src/emailAuthTypes.ts:308