Plain definition
Definition of Magic Link Authentication
A passwordless sign-in method that emails a user a short-lived, single-use URL containing a cryptographic token that logs them into your app when opened.
User Submits Email -> Server Stores Hashed One-Time Token (10-15 min TTL) -> Email Link Clicked -> Session Cookie IssuedWorked example
Suppose a solo founder launches a made-up podcast show-notes tool called CastMemo at `https://app.castmemo.example`. To skip password resets and signup friction, CastMemo offers email magic links alongside OAuth sign-in. When a listener types `alex@studio.example` into `POST /auth/magic-link`, the backend generates 32 random bytes from a CSPRNG, stores only the SHA-256 hash of that token with a 15-minute expiration timestamp in the database, and emails `https://app.castmemo.example/auth/verify?token=...`.
Notice one subtle detail: corporate security gateways frequently pre-fetch every URL inside incoming emails to check for malware. If `GET /auth/verify` consumed the token on page load, the email scanner would burn Alex's single-use token before Alex ever clicked it. Instead, CastMemo renders a lightweight page with a 'Complete sign-in' button that submits a `POST` request to exchange the token for an `HttpOnly` session cookie and marks the token used atomically.
Why it matters when you launch
For an early v1, removing password creation eliminates credential-reuse risk on your database and cuts support tickets from forgotten passwords. Platforms like Supabase Auth and Auth0 provide passwordless email flows out of the box, enforcing one-time token consumption and allowlisted redirect URLs so attackers cannot hijack the post-login destination.
Still, magic links depend heavily on email deliverability and browser behavior. Auth0's docs warn that flows tied strictly to the initiating browser fail when iOS users request a link in Chrome and tap it in Mail, which opens Safari. Sending clean transactional emails from a verified domain and adding a 6-digit OTP fallback keeps mobile users from getting stranded.
Common mistakes
- Consuming the single-use token automatically on a `GET` request, allowing corporate email link scanners to invalidate links before the user clicks.
- Accepting an arbitrary `redirectTo` query parameter without an exact URL allowlist, turning your login link into an open-redirect phishing vector.
- Setting token expiration windows to hours or days, or forgetting to invalidate a token immediately after its first successful redemption.
- Failing to rate-limit the magic-link request route or provide a 6-digit email OTP alternative when users open links in a different mobile browser.
Tools and guides that use it
Free tool
Launch Day ChecklistEverything to check before, during and after launch day, saved in your browser.Free tool
SaaS Privacy Policy & Terms GeneratorGenerate clean, developer-friendly Privacy Policy and Terms of Service agreements for Stripe, Google OAuth, and product launches.Founder guide
SaaS Onboarding for Solo Founders: Turn Signups Into Active Users (2026)A practical setup for turning new signups into activated users using one clear outcome, low-friction auth, templates, and three short emails.Founder guide
Privacy Policy and Terms of Service for a New SaaS (2026)What your legal pages need to cover before launch, what GDPR, CCPA, Stripe, Google OAuth and app stores check, and when to hire a lawyer.Related glossary terms
Official sources
Pritam Ghosh runs Hauntboard and maintains this glossary.
Published · Updated
Building something real? Launch it in public.
A person reviews every launch on Hauntboard, and every view and visit it sends your site is published on your launch page. Free to submit.