Use Cases

Email verification code vs link, and which one to send

Both prove the same thing. The difference shows up when a scanner clicks first, when the mail opens on a different device, and when you try to write a test for it.

On this page
  1. Both prove the same thing
  2. Where the link wins
  3. Where the code wins
  4. The failure nobody tests: something clicks the link first
  5. What the auth providers actually do
  6. Testing whichever one you send
  7. Where InboxDome is the wrong tool

Send a code when the person reading the mail might not be on the device that started the signup. Send a link when they almost certainly are and you want the flow to be one tap. That is the email verification code vs link question settled on the only ground that matters. On security the two are equivalent: each is a secret posted to a mailbox, and each proves one thing, that whoever opened it controls the address.

The rest is failure modes. Here are the ones that bite, and how to test whichever you send.

Both prove the same thing

A six digit code and a click through link are the same credential wearing different clothes. Neither is a second factor. NIST SP 800-63B says plainly that methods which do not prove possession of a specific device, such as VOIP or email, shall not be used for out of band authentication. Email proves control of an address, which is what signup verification needs and not what multi factor authentication needs.

So do not pick a format because it feels safer. Pick on what happens in a real mailbox.

One tap, no transcription. Nobody misreads a 0 as an O, and nobody alt tabs to copy six digits across. The link also carries state the code cannot: which signup it belongs to, which plan was chosen, where to send the user afterwards. That is plumbing you would otherwise rebuild from a session cookie that may not exist any more.

It is also the default almost everywhere. Supabase’s passwordless endpoint is labelled OTP but sends a magic link unless you change the template, and its documented defaults are a one hour expiry, one request per 60 seconds, and one time use.

Where the code wins

The link’s advantage evaporates the moment the mail is read somewhere else. Signup starts in a desktop browser, the confirmation lands on a phone, the user taps it, and now they are signed in on the phone while the laptop shows a spinner. Firebase documents the consequence: completing an email link on a different device requires the address to be supplied again, to prevent session fixation.

A code crosses that gap by hand. It also survives plain text clients and locked down mail apps that render links as dead text, which is not an edge case if you sell to enterprises.

This is the one that turns a settled email verification code vs link decision into a support queue. Corporate mail filters do not wait for the user. Microsoft’s Safe Links performs URL scanning and rewriting of inbound messages during mail flow plus time of click verification, and its docs note that URLs without a valid reputation are detonated asynchronously in the background.

Detonated means fetched. If your verification link consumes its token on GET, the scanner can burn it minutes before the recipient opens the message, and your user is told the link expired on a link they never touched. The fix is not a longer expiry. It is to make the link land on a page with a confirm button and consume the token on POST. A code has no such problem, because nothing in the mail path can type it into your form.

What the auth providers actually do

If you are building this rather than testing it, the honest answer is to not build it. Supabase Auth and Firebase Authentication both ship the whole flow, both offer the code and the link from the same call, and both bring expiry and rate limit handling you would otherwise get wrong. In both, email verification code vs link is a template decision rather than an architecture. Auth0, Clerk and the rest cover similar ground; check their own docs for current behaviour rather than trusting a comparison table, this one included.

On the testing side the tools split by intent. An email sandbox such as Mailtrap captures outbound mail from staging so it can never reach a real person, which is the right answer when your fear is a test run mailing your customer list. A real receivable inbox is the right answer when your fear is whether the message leaves, arrives, authenticates and renders.

Testing whichever one you send

Whichever way the email verification code vs link call goes, the test has the same shape. Create an inbox, trigger the signup, then block until the mail lands instead of sleeping:

curl "https://inboxdome.com/v1/inboxes/$INBOX_ID/wait?for=otp&timeoutSeconds=30" \
  -H "Authorization: Bearer $INBOXDOME_KEY"
# -> { "otp": { "value": "482913" } }

For the link format, the message exposes a parsed links array with a type and a confidence, so the test can pick the action link instead of regexing over HTML and grabbing the unsubscribe footer. Match on your own known URL shape.

One warning follows from the section above. The linkResponds assertion fetches the detected link server side and fails on a 4xx or 5xx. It is useful, and it will burn a single use token before your browser gets there, exactly like a corporate scanner. Good bug to find in CI, bad one to find in production. The full recipe is in how to test OTP verification end to end; the assertion list, including SPF, DKIM and DMARC results, sits on the Email Testing API page.

Where InboxDome is the wrong tool

Plainly, because it comes up:

  • It cannot send. Inboxes are receive only by design. If a test needs to reply to a message or send from the test address, this is the wrong service.
  • It does not keep mail. A consumer inbox lives 24 hours by default and stretches to seven days at most, then a cleanup job that runs every 15 minutes destroys it. If verification mail has to survive as an audit record, keep it in your own system.
  • The domains are shared and public, so your own signup gate may reject them. That is the gate working; read how sites detect disposable addresses before allowlisting anything in a non production environment.
  • It will not make the decision for you. InboxDome is an inbox, not an auth provider; it shows what your product sent and whether it survived the trip.

If you just need to receive a verification message without handing over a real address, open a free temporary inbox and paste the address in. For CI, the free tier covers 100 inbox tests a month and the API reference has the calls.

Disclosure: InboxDome publishes this blog and makes the products it mentions. We describe what they do rather than promise results.

Key takeaways

  • Both options prove one thing: that someone can open that mailbox. Neither is a second authentication factor.
  • Codes survive a cross device signup. A link signs the user in on whichever device happened to read the mail.
  • Corporate mail scanners follow links before the user does, so a single use link consumed on GET can arrive already dead.
  • Links carry state and cut the flow to one tap, which is why most auth providers send one by default.
  • Test whatever you send against a real inbox: wait for the code or the parsed link, then assert the message authenticated.

Sources

  1. NIST SP 800-63B, Digital Identity Guidelines (Authentication) — Section 5.1.3.1 on out of band authenticators, and why email does not qualify as one.
  2. Microsoft, Complete Safe Links overview for Defender for Office 365 — Documents URL rewriting during mail flow, time of click verification, and asynchronous detonation of links without a valid reputation.
  3. Supabase Auth docs, passwordless email logins — One endpoint for both formats: the magic link and the OTP code differ only in the email template. States a one hour expiry, a 60 second resend limit, and one time use.
  4. Firebase Authentication, email link sign in for web — Requires the email address again when the link is completed on another device, to prevent session fixation.

Links last checked September 5, 2026.

Frequently asked questions

Is a magic link more secure than an emailed code?

Not meaningfully. Both are secrets delivered over the same unencrypted channel, and anyone who can read the mailbox can use either. NIST SP 800-63B is blunt about the channel, stating that methods which do not prove possession of a specific device, such as VOIP or email, shall not be used for out of band authentication. Choose on user experience and failure modes, not on a security claim.

Which one do users complete more often?

It depends almost entirely on your device split. If people sign up on a laptop and read mail on a phone, a code converts better because it crosses the gap by hand. If the signup starts in a mobile browser and the mail lands on the same phone, the link wins on taps. Measure your own funnel rather than trusting a generic figure.

How long should the code or the link stay valid?

Minutes for a code, up to an hour for a link is the common shape. Supabase documents a one hour default expiry for its email links, one request per 60 seconds, and one time use. Shorter is safer as long as resending is easy and obvious.

Can I send a code and a link in the same email?

Yes, and many products do. Two rules make it safe. Both paths must consume the same token so that using one kills the other, and both must expire together. Also make the link land on a page with a confirm button rather than verifying on load, so a link scanner cannot finish the flow on the user's behalf.

InboxDome TeamEmail infrastructure builders

The InboxDome team runs the temporary-email service and email-testing API this blog belongs to. We write about disposable inboxes, email privacy and testing transactional email, based on operating the infrastructure ourselves.