Supabase Auth redirect not working in production: developer checklist
Magic links and confirmation emails keep sending users back to localhost:3000 or failing silently on your live domain. Follow this production checklist to fix redirect loops.
The Localhost Redirect Trap
During development inside Lovable, Bolt, or Cursor, your Supabase client was pointed to http://localhost:5173 or a preview sandbox domain. When non-technical founders launch their live domain, users report that clicking the confirmation email redirects them back to localhost or throws an invalid redirect error.
Checklist: 4 Essential Settings in Supabase Dashboard
- Site URL: Go to Authentication -> URL Configuration. Set the Site URL to your live canonical domain:
https://yourapp.com. - Redirect URLs (Allow list): Add explicit wildcard entries:
- https://yourapp.com/**
- https://.vercel.app/* (for staging previews)
- Email Template Redirects: Ensure your email templates use
{{ .SiteURL }}/auth/callbackinstead of hardcoded addresses. - Local Storage Session Persistence: Verify your Supabase client initializes with
persistSession: trueand usesautoRefreshToken: true.
Need an engineer to fix your login flow?
We configure your redirect URLs, session persistence, and OAuth providers in under 48 hours.
Get the Login & Auth Fix
MERN developer in Pakistan fixing React, Node.js, Supabase, and Stripe apps for founders worldwide. About Safdar Rehman
Login & Auth Fix — $149
Fixed price, separate GitHub PR, and Loom walkthrough in 24–48 hours.
See Login & Auth details