Lovable sign-in works in preview but fails on the published app or custom domain

Login works in the Lovable preview and breaks on the published app or your own domain? Lovable says the address is usually missing from the auth redirect URLs.

Short answer

Lovable says the published URL or custom domain is missing from your project's redirect URLs. On the built-in backend, open More → Users → Settings → Advanced, add the address to Redirect URLs, and check that the Site URL is your live address. On your own Supabase project, add it under URL Configuration in the Supabase dashboard. Then sign in again on the live address.

Reviewed October 25, 2026

What it means in plain English

Lovable's auth guide answers this exact question: "Why does sign-in fail on my published app but work in preview?" Its answer: "The published URL or custom domain is missing from your project's redirect URLs."

Auth keeps two settings. The Site URL is "the default URL users are redirected to after authentication when no redirect URL is specified." Redirect URLs are "up to 50 URLs that auth providers are permitted to redirect to after authentication." If the address people actually use is not on that list, the sign-in can't send them back there.

Where you fix it depends on which backend the app uses:

  • Lovable's built-in backend (Cloud). Lovable keeps both settings up to date for you. When you publish, it sets the Site URL to your published lovable.app address. When you connect a custom domain, it adds that domain to the redirect URLs. Lovable notes that a Site URL you set yourself stays unchanged.
  • Your own Supabase project. Lovable says these apps "get no automatic updates, so add the addresses in that project's auth settings."

Likely causes

  • The app uses your own Supabase project, and the published lovable.app address or custom domain was never added in Supabase's URL Configuration.
  • You set the Site URL by hand earlier, for example to a preview or test address. Lovable leaves a Site URL you set yourself unchanged.
  • The custom domain is not Live yet. On the built-in backend, Lovable adds a custom domain to the redirect URLs "when the domain becomes Live".
  • Google sign-in uses your own Google OAuth credentials, and the new domain's redirect URI is missing in Google Cloud Console or not selected in Lovable.

How to fix it, step by step

  1. Find out which backend the app uses. Lovable's Supabase guide says auth settings for a connected Supabase project "live in your Supabase project, not in Lovable."
  2. Built-in backend: open More → Users → Settings → Advanced → Redirect URLs and add the published address or custom domain. Lovable also says you can ask in the project chat to add your domain to the auth redirect URLs. Check that the Site URL under Advanced is your live address and not an old one you typed in.
  3. Your own Supabase project: in the Supabase dashboard, open the URL Configuration page. Supabase says the Site URL "defines the default redirect URL when no redirectTo is specified in the code" and to change it "from http://localhost:3000 to your production URL". Add the live address to the Redirect URLs list too.
  4. If the code passes redirectTo, Supabase says that URL "should match the Redirect URLs list configuration". Add the exact URL, including any path such as /auth/callback. Supabase recommends the exact redirect path in production rather than a ** wildcard.
  5. If the app sends confirmation or reset emails with redirectTo, Supabase says you may need to replace {{ .SiteURL }} with {{ .RedirectTo }} in the email templates.
  6. Google with your own credentials: Lovable adds a redirect URL for a new custom domain under More → Users → Settings → Google but does not select it. Add that URL as an Authorized redirect URI in Google Cloud Console, then select it in Lovable and click Save. Lovable says that until you do, Google sign-in fails on the new domain with a redirect URI mismatch error. Managed by Lovable mode needs no change. The Supabase-project version of this is Lovable Google sign-in fails on a custom domain.
  7. Read the error. Supabase says that when authentication fails, the user is still redirected, and "the error details will be returned as query fragments in the URL", as error_code and error_description.

How to check it worked

  • Sign in on the published lovable.app address and on the custom domain. Both return you to the same address, signed in.
  • The address bar never ends on localhost. If it does, see Supabase login redirects to localhost.
  • On your own Supabase project, the new user appears under Authentication in the Supabase dashboard.

Wrong email or password is a different error. See Supabase Auth invalid_credentials.

Not your symptom? Match other login problems in Lovable authentication errors.

Questions people ask

Why does sign-in work in preview but not on my published Lovable app?

Lovable says the published URL or custom domain is missing from your project's redirect URLs. Add that address to the Redirect URLs list and make sure the Site URL is your live address.

Does Lovable add my custom domain to the redirect URLs automatically?

On the built-in backend, yes, when the domain becomes Live. Apps that use your own Supabase project get no automatic updates, so add the domain in that project's auth settings.

Do I need to change Google Cloud Console too?

Only if Google sign-in uses your own Google OAuth credentials. Add the new domain's redirect URL as an Authorized redirect URI in Google Cloud Console, then select it in Lovable and click Save. Managed by Lovable mode needs no change.

Sources

More Supabase auth and email fixes

More Google sign-in fixes

More Lovable fixes

Keep going on your own.

The guides stay free. A deep leak report is $15. Fix packs are $24, or $49 for all three. There is no done-for-you repair.

See products