Email Link and Code
Email authentication sends one challenge containing both a one-time sign-in link and a six-digit code. Redeeming either credential consumes the shared challenge.How It Works
SDK Usage
Step 1: Send the Magic Link
Step 2: Handle the Callback
On your callback page (e.g./auth/callback), read the URL params and verify:
React Usage
Login Component
Callback Component
Mount<StewardEmailCallback> on your callback route to handle token verification automatically:
token and email from the URL search params, calls verifyEmailCallback, and shows loading/success/error states.
Server Configuration
To enable email auth on a self-hosted instance:Steward uses Resend for email delivery. Create a free account at resend.com and verify your sending domain. The free tier supports 100 emails/day.
Callback URL
The magic link directs users to:/auth/callback that handles this. If you need a different path, configure EMAIL_CALLBACK_PATH in your environment.
API Endpoints
Security
- The shared link and code expire after 10 minutes
- Link and code are one atomic challenge: either can win exactly once
- Link tokens and polling secrets are cryptographically random (32 bytes)
- Link tokens are SHA-256 hashed and codes use keyed HMAC at rest
- Five wrong code attempts hard-lock the challenge; API and destination rate limits also apply
- Polling is status-only so an unsolicited magic-link click cannot transfer a session to the requester
Related
- Auth Overview — Session management and token lifecycle
- Passkeys — Alternative passwordless method
- React Components —
<StewardLogin>and<StewardEmailCallback>