Lovable Login Works in Preview but Fails on the Live URL
Quick Answer
How do I fix Lovable Login Works in Preview but Fails on the Live URL?
Supabase auth redirect URLs are set to localhost by default. After deploying to Vercel, the redirect URL must be updated in Supabase settings. Start with "Open Supabase auth settings" before making broader code changes.
Fix signals
- What this answers
- Why lovable login works in preview but fails on the live url happens and what to change first.
- Fastest move
- Open Supabase auth settings
- Use this page if
- Login works in preview but fails on the live URL
If this keeps happening
Open the next decision, not just the patch
Use these when the current fix is helpful, but the real answer is a better tool choice, a cleaner workflow layer, or a more trustworthy launch path.
Lovable reviews
Open this when the same full-stack MVP failures keep repeating and you need a harder answer on whether Lovable is still the right bet.
Open this next →
Cursor review
Open this when the pattern behind the bug is really about generated speed versus owning more of the stack in code.
Open this next →
Deploy hub
Open this when the fix is exposing a bigger production handoff problem, not just one broken feature.
Open this next →
Tool picker
Open this when the repeated bug is making you question the whole stack choice instead of the latest patch.
Open this next →
Firecrawl review
Open this when the app also needs live web data and the next stack decision is no longer only about the builder itself.
Open this next →
Quick Fix Summary
| Most likely cause | Supabase auth redirect URLs are set to localhost by default. After deploying to Vercel, the redirect URL must be updated in Supabase settings. |
| Fastest fix | Open Supabase auth settings |
| Use this page if | Login works in preview but fails on the live URL |
Exact errors people search for
If one of these matches what you are seeing, you are likely on the right fix page.
Login works in preview but fails on the live URL Lovable auth works in preview but breaks after deploy Redirect after login goes to localhost or the wrong URL Email confirmation link sends users to localhost or the wrong domain
You're in the right place if...
- !Login works in preview but fails on the live URL
- !Redirect after login goes to localhost or the wrong domain
- !Email confirmation link works but users never land back in the app
Why this happens
Supabase auth redirect URLs are set to localhost by default. After deploying to Vercel, the redirect URL must be updated in Supabase settings.
Fix
Open Supabase auth settings
Go to Supabase Dashboard → Authentication → URL Configuration
Update redirect URLs
Replace the localhost URLs with your production domain:
Site URL: https://your-domain.com Redirect URLs (add all of these): https://your-domain.com/** https://your-app.vercel.app/**
Redeploy on Vercel
After updating Supabase settings, redeploy your app on Vercel to ensure the changes take effect.
Prevent this next time
Add your production domain to Supabase redirect URLs BEFORE your first deploy. This prevents login issues from day one.
Frequently Asked Questions
Preview uses localhost URLs. Production needs your actual domain added to Supabase's allowed redirect URLs.
Add both your-domain.com/** and your-app.vercel.app/** to handle both URLs.
Related fixes
Lovable App Shows a Blank Screen After Deploy
Lovable Form Submits but Supabase Saves Nothing
Clerk Login Works Locally but Fails After Deploy
Lovable App Takes 3-5 Seconds to Load
Why Does Lovable Keep Changing Things I Didn't Ask For?
Lovable Stripe Checkout Fails or Cards Are Declined