Stop Pretending Email Verification Is Simpler Than It Actually Is
Adil Sher
Author
Last year, I shipped a tenant signup flow for a property management platform in Islamabad. The product team wanted a "simple fallback" when SMS wasn't available, just send an email verification link, right? Six weeks later, we were debugging a production incident where users had somehow verified their accounts twice with expired tokens, and I was staring at a codebase that treated email delivery as proof of account ownership. That's when I realized: I didn't actually understand what I was building.
This is the gap I keep seeing in authentication discussions. We talk about magic links and OTP codes like they're interchangeable widgets we can swap based on convenience. They're not. I spent too long learning this the hard way, so let me break down what I've actually come to believe about email fallbacks for authentication.
The Credential Lifecycle Is Not Optional
Here's what killed me about my first attempt: I was measuring success at the wrong place. The team asked, "Did we send the email?" I'd say yes and move on. But sending an email is not verification. Delivery is not verification. A user clicking a link is not verification either, that's just the beginning.
The actual question is brutal: what moves an account from pending to verified, and who owns ensuring that happens exactly once? That's the work that matters. A magic link hides this complexity behind a nice UX, but it doesn't eliminate it. You still need to generate a one-time credential, store it securely, enforce expiration, handle attempt limits, and implement the atomic transition that says "this account is now verified."
I see developers count the lines of code for sending an email and think that's the integration. It's not. That's the paint. The house is everything underneath.
Code vs. Link: It's About What Fits Your System
Here's where I actually disagree with oversimplifying this choice. Picking between an email code and a magic link shouldn't be "which is easier?" It should be "which fits my existing architecture without creating new problems?"
If your system already has a pending account record and you can atomically transition it to verified without race conditions, great. A magic link might actually reduce friction by skipping the form entry step. But if you don't have that infrastructure, adding it just to avoid showing a code form is premature optimization dressed up as UX improvement.
For my current setup, we went with email codes because we already had a code-entry form for SMS fallback. Reusing that form meant one code generation and verification path, not two. One credential lifecycle to maintain, not two. That mattered more than the typing step.
What Actually Needs to Happen
Let me be specific about what I'm tracking now in production:
-
Delivery event, We sent the message. This is transport confirmation. It's useful for monitoring but means nothing about account state.
-
Credential redemption, The user submitted the code (or clicked the link). This is when the account transitions. This is the only signal that moves state.
-
Event polling overhead, If you're checking an external provider's API for delivery status, budget that latency into your design. SMS cancellation is different from email cancellation. State that explicitly.
-
State management between attempts, Before sending a reminder, check if the signup is still pending. Don't rely on canceling a scheduled email. The timing assumptions don't work.
The original article gets at something important here: configuration effort is hidden. We talk about "low-effort" integrations, but we're really just not counting the work we're pushing into application logic.
The Code I'd Actually Write
Here's how I think about reading delivery events without confusing them with verification:
async function verifySignupCredential(
signupId: string,
submittedCode: string
): Promise<boolean> {
// Check signup is still pending BEFORE anything else
const signup = await db.getSignup(signupId);
if (signup.state !== 'pending') return false;
// Verify the code itself
const storedHash = await db.getCredentialHash(signupId);
const isCodeValid = await verifyHash(submittedCode, storedHash);
if (!isCodeValid) return false;
// Check expiry
const createdAt = signup.credentialCreatedAt;
if (Date.now() - createdAt > EXPIRY_MS) return false;
// Atomically transition state
const updated = await db.updateSignupState(signupId, 'verified');
return updated.state === 'verified';
}
This separates concerns: delivery status lives in monitoring. Credential verification lives here. Account state transitions happen explicitly.
The Real Question I Have
I want to push back on something the industry accepts too easily: the assumption that email fallback maintains the same assurance level as SMS for login verification. It doesn't, and NIST's guidance backs this up. Email is fine for signup verification, you're confirming mailbox ownership and account creation. It's not the same as proving you're the legitimate login owner later.
We need to stop treating these as equivalent problems.
What's your experience been? Have you built email fallback flows that actually handled the lifecycle well, or did you end up maintaining credential state in ways that surprised you?
Source: This post was inspired by "Node.js Email Fallback: 5 Signup Checks for Magic Link vs SMS OTP" by Dev.to. Read the original article