What is a magic link?

A magic link is a short-lived, one-time URL sent via email that signs a user in when clicked.

· LoginWith team

A magic link is a sign-in mechanism where the user receives an email with a one-time URL. Clicking the link authenticates them, no password required.

The flow

  1. User enters their email
  2. You generate a random, short-lived token
  3. You email them a link like https://yourapp.com/magic/<token>
  4. They click, you verify the token, create a session, and redirect to the app

Why use them

  • Fewer credentials to manage — no password storage, no password reset flow
  • Lower support burden — “forgot password” tickets become rare
  • Better UX for monthly-active users — no password to remember

Tradeoffs

  • Dependent on email deliverability — a mailbox in the spam folder means no sign-in
  • Higher friction for daily users — checking email every day is annoying
  • Bearer property — anyone with read access to the mailbox can sign in

Security rules

  • Expire tokens in 10-15 minutes. Longer than that, the risk of email mailbox exposure is too high.
  • Mark tokens as single-use; invalidate on first click.
  • Generate at least 32 bytes of randomness.
  • Rate-limit token requests to prevent inbox flooding.

Magic links pair well with passkeys for a password-free experience.

See the full auth glossary for related terms.

Want auth that just works?

Get started with LoginWith