Lovable·Fixauthbeginner

Lovable Login Not Working After Deploy

Quick Answer

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.

You're in the right place if...

  • !Login works in preview, fails on live URL
  • !Redirect after login goes to wrong URL
  • !Email confirmation link broken

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

1

Open Supabase auth settings

Go to Supabase Dashboard → Authentication → URL Configuration

2

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/**
3

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

Weekly Newsletter

Get next week's fix before you need it.

Join developers getting weekly vibe coding tips, error fixes, and tool updates.

Subscribe on Substack →