SaaS makers · Passwordless sign-in
Magic Link Expired on Click: Blame Email Scanners
Short answer
An email security scanner probably opened the link first and used it up, so count sign-in errors by type and add a code or a confirm button.
GimmeTheSauce editorial · · Updated

Your customer probably didn’t click it first. Some email providers run security checks that open every link in an incoming email, Safe Links in Microsoft Defender for Office 365 being one example. A one-time sign-in link works once, so the scanner uses it and the customer sees an error. Supabase documents exactly this: the link is consumed instantly, which leads to “Token has expired or is invalid”. Supabase’s email template limitations
Confirm it’s the scanner
Count sign-in attempts and errors by type for a week, without storing addresses. Group the errors by kind of address, work domain or consumer mailbox. A hypothetical week:
| Week | Sign-in links sent | Succeeded | Expired or invalid |
|---|---|---|---|
| Before the change | 300 | 255 | 45 (15%) |
| After adding a confirm page | 300 | 288 | 12 (4%) |
Before the change, 31 of the 45 errors came from work addresses. The rest were people opening an older email or requesting a second link and clicking the first. That pattern points at a scanner: the people who were failing were the ones whose company filters their mail.
Make the link survive a scanner
Supabase suggests two fixes:
- Send a code. Include a one-time code in the email and let people type it into your sign-in page. A scanner can’t type a code.
- Link to a page with a button. The email links to your own page, and the actual sign-in happens only when the person presses a confirm button there. A scanner opens the page but doesn’t press the button.
The button page keeps the one-tap feel; the code works even if the email is opened on another device. Either way, show a clear message when a link has already been used, with a button to send a new one. Don’t just say “expired”.
The same applies to signup confirmation emails. If people never confirm their address, check whether some of them confirmed and got an error. A sign-in method with no email link, such as Sign in with Google, avoids the problem for the people who choose it.
Bring your weekly sign-in counts and error types to Pieter Levels’s AI mentor to pick the fix ↗. Use counts, not email addresses.
Keep learning
Terms used in this note
Every Tuesday and Friday
The sauce from founders who print, twice a week.
Each issue, 3 moves from a different set of founders who print, straight from their own posts and podcasts: their real numbers, how they did it, and one thing to try that week.
Free. Unsubscribe in one click.