Skip to content

fix(auth): make emailed login/reset links scanner-safe - #67

Merged
pranavb05 merged 1 commit into
mainfrom
fix/scanner-safe-auth-links
Aug 25, 2026
Merged

pranavb05 merged 1 commit into
mainfrom
fix/scanner-safe-auth-links

Conversation

@pranavb05

Copy link
Copy Markdown
Contributor

Problem

Invite/reset links "expire instantly". Root cause: /admin/login/link auto-redirected to Supabase's /auth/v1/verify on page load. Our users are on @ufl.edu (Microsoft 365), and Outlook/Defender Safe Links prefetches every emailed URL — that prefetch followed the redirect and consumed the single-use token before the human ever clicked.

What

  • /admin/login/link now renders a confirmation button; verification fires only on an explicit click (scanners don't click).
  • The email URL now carries the link type; recovery links redirect to /admin/login/reset-password (which already handles the token hash) instead of the previous hardcoded type=magiclink → /admin/login/, which broke reset flows.
  • Removed console.log of the live action link (credential leak into Vercel logs — audit finding).

Verification

  • npm run build passes.
  • To test end-to-end: create a test user / trigger a reset to a @ufl.edu address and confirm the link works after sitting in the inbox.

The /admin/login/link page auto-redirected to Supabase's /auth/v1/verify
on load, so email security scanners (e.g. Microsoft Safe Links, which
prefetch every link for @ufl.edu recipients) consumed the single-use
token before the user clicked — links appeared to expire instantly.

- Render a confirmation button instead; verification now only fires on
  an explicit click
- Pass the link type through the email URL and route recovery links to
  the reset-password page instead of hardcoding type=magiclink
- Stop logging the live action link
@vercel

vercel Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ufdsi-com Ready Ready Preview Aug 25, 2026 10:17pm

@pranavb05
pranavb05 merged commit afdd5e5 into main Aug 25, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
Preview – ufdsi-com — 41851860 Deployed Aug 25, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant