Lovable Google sign-in fails on a custom domain
Sign in with Google works on the Lovable URL and fails on your domain? Add that origin in Google and in Supabase Redirect URLs.
Reviewed October 17, 2026
What it means in plain English
Google and Supabase both keep a list of URLs they will send the user back to. Connecting a custom domain gives the app a new origin. The Lovable URL can stay on the old list while the custom domain is missing, so Sign in with Google fails only there.
Lovable's Supabase guide says authentication settings live in the Supabase project, not in Lovable. You enable Google in the Supabase dashboard and paste the OAuth client id and secret. Lovable can add the button. It does not update Google Cloud or Supabase's redirect list for you.
Likely causes
- Authorized JavaScript origins in Google Cloud has
https://your-app.lovable.appand nothttps://yourdomain.com. Supabase's Google guide says those origins should also be the Site URL or redirect configuration in the project. - Supabase Redirect URLs does not include the custom domain. For a PKCE flow,
redirectTohas to be on that allow list. The Site URL is the default when the code does not passredirectTo. - Google's Authorized redirect URIs is missing the callback from Supabase's Google provider page. That callback is the Supabase URL, not your custom domain. A mismatch is Error 400: redirect_uri_mismatch.
- The domain itself does not load. Fix DNS first. See Lovable custom domain not working.
How to fix it, step by step
- Supabase → Authentication → URL Configuration. Set Site URL to
https://yourdomain.com. Add that same origin to Redirect URLs, including any path your app uses asredirectTo, such ashttps://yourdomain.com/auth/callback. - Supabase → Authentication → Providers → Google. Copy the Callback URL shown there.
- Google Auth Platform → Clients → your Web application client. Under Authorized JavaScript origins, add
https://yourdomain.com. Supabase's example: if the app is hosted athttps://example.com/app, addhttps://example.com. Under Authorized redirect URIs, paste the Supabase callback URL exactly. - Confirm the client id and secret on the Supabase Google provider page are from that same client.
- In the app, pass the custom-domain callback as
redirectTowhen you use a code exchange. Supabase's example isredirectTo: 'http://example.com/auth/callback'. Use yourhttpsorigin. An implicit flow can omit it and then uses the Site URL. - If Google still sends people to localhost, the Site URL was not saved. See Supabase login redirects to localhost.
- Paste this to Lovable:
Google sign-in fails on the custom domain and works on the Lovable URL. Do not change the Supabase project URL. Use signInWithOAuth for Google with options.redirectTo set to https://YOURDOMAIN/auth/callback. I will add that URL in Supabase Redirect URLs and add https://YOURDOMAIN as an Authorized JavaScript origin in Google. The Authorized redirect URI stays the callback URL from Supabase's Google provider page.
How to check it worked
- On
https://yourdomain.com, Sign in with Google reaches the consent screen and returns to that domain signed in. - The address bar never shows
redirect_uri_mismatchorlocalhost. - A user created this way appears under Authentication in the Supabase dashboard.
Not your symptom? Match other login problems in Lovable authentication errors.
Sources
Related 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.