← Blog · Published Oct 19, 2026 · by the Vibefixr team

Google login sends users to localhost after you publish? Here’s the fix

Quick answer: Why does Supabase redirect to localhost after Google login in production?

Supabase sends users to the Site URL when your code doesn’t pass a redirect URL, or passes one that isn’t on the allow list, and that setting starts out as http://localhost:3000. Change Site URL to your live domain under Authentication → URL Configuration, and add your production and preview URLs to Redirect URLs. Magic links and password-reset emails use the same settings.

You click “Sign in with Google” on your freshly published app, pick your account, and land on http://localhost:3000/#access_token=…, a page that can’t be reached. In the preview it worked perfectly. This is one of the most common “works in preview, broken live” problems, and it’s almost always two settings, not code.

What it looks like

Why it happens

Supabase Auth only sends users to addresses you’ve approved. Two settings control that, both in your Supabase dashboard under Authentication → URL Configuration:

So if the Site URL is still localhost and your live domain isn’t on the list, every login ends up on localhost. Supabase’s own troubleshooting note gives the same answer: the exact URL has to be in the Redirect URLs setting.

The fix in two settings

1. Set Site URL to your live domain

For example https://yourapp.com. Use your real production address, with https://. Wildcards aren’t allowed in the Site URL.

2. Add your Redirect URLs

Add the exact production URL your app returns to, for example https://yourapp.com/auth/callback if you have a callback page, or https://yourapp.com/** if you’re not sure yet. Keep http://localhost:3000/** for local development. For preview deployments, Supabase documents patterns like these:

https://**--my_org.netlify.app/**
https://*-<team-or-account-slug>.vercel.app/**

Matching is strict. http vs https, www vs no www, and a trailing slash all count as different URLs.

3. Google Cloud Console: point Google at Supabase, not at your app

If you use your own Google OAuth credentials, the Authorized redirect URI in Google Cloud Console must be your Supabase project’s callback URL, which you can copy from the Google provider page in the Supabase dashboard. It isn’t your app’s address. Google sends the user to Supabase, and Supabase sends them on to your app. Per Supabase’s Google guide, the local equivalent is http://127.0.0.1:54321/auth/v1/callback.

On Lovable Cloud? According to Lovable’s auth docs, the same two settings sit under More → Cloud → Users → Auth settings → Advanced, and Lovable updates them for you: it sets the Site URL to your published lovable.app address and adds a connected custom domain to the redirect URLs. A Site URL you set yourself isn’t touched, and apps on your own Supabase project get no automatic updates. If you use your own Google credentials, a new domain also needs a redirect URI in Google Cloud Console.

Not sure which of these is your problem? The free health check looks at your live app in seconds, or request a free scan and we’ll tell you what we find.

Keep previews working without opening everything

It’s tempting to add one giant wildcard and move on. Supabase’s recommendation is that ** is fine for local development and preview URLs, but your production entry should be the exact URL. The allow list is a security control: it stops an attacker from crafting a login link that sends a freshly signed-in user, and their token, to a site the attacker controls. Keep the patterns as narrow as your hosting allows.

Still landing on localhost?

When it’s more than a setting

One provider and one domain is a five-minute fix. It gets messy with several providers, a custom domain plus lovable.app, preview branches, email links, and a server-side callback, where every flow has to land in the right place. That’s when a review saves you from finding out from users.

Fixed the setting, but login still breaks somewhere?

The $49 Audit reviews your app’s login flows (Google, magic links, password reset, previews) as part of a security & stability review, with a full report in 24 hours and copy-paste fix prompts for your AI tool. Or let us do it: the $199 Fix covers up to 5 issues as a pull request with tests within 72 hours. Not fixed? Full refund.

Get the $49 auditFix my app ($199)Free health check

FAQ

Do I need to change anything in Google Cloud?

Only if you use your own Google OAuth credentials. Then the Authorized redirect URI must be your Supabase project’s callback URL (shown on the Google provider page in Supabase), not your app’s URL. A new domain also needs adding there.

Can I keep localhost for development?

Yes. Keep http://localhost:3000/** (or your dev port) in Redirect URLs. Just don’t leave it as the Site URL.

Is a wildcard like ** safe in production?

Supabase recommends ** only for local development and preview URLs, and the exact URL for production. Narrow patterns keep logins from being sent anywhere you didn’t intend.

Why do password-reset emails still link to localhost?

They use the same Site URL (or the redirect URL your code passes). Fix the setting, then send a new email. Links in old emails keep their old address.

I use a custom domain now. What changes?

Set the Site URL to the new domain and add it to Redirect URLs, plus Google Cloud Console if you use your own credentials. On Lovable Cloud, Lovable adds a connected custom domain to the redirect URLs for you.

Related guides

Launching soon? Run through our launch checklist for AI-built apps: 14 checks, each linked to the full guide.

Sources: Supabase: Redirect URLs · Supabase: Login with Google · Supabase: Email templates · Lovable: Users and authentication

Information here is checked against official docs at the time of writing. Platforms change, so verify against the linked sources.