Lovable Google sign in showing redirect_uri_mismatch or an unverified app warning

Updated · by Zane

What the error means

When someone clicks Sign in with Google, your app sends them to Google together with a return address. Google compares that address with the list on your OAuth client. If it is not on the list, the person sees Error 400: redirect_uri_mismatch. Google's developer documentation says the address must match exactly, and that scheme, case and trailing slash all count.

This guide is about the Google side of the problem. If your login works on Google but then lands on localhost or a preview address, that is a different setting, covered in login redirects to localhost after publishing.

Google compares the return address your app sends with the Authorized redirect URIs on the OAuth client, and the two must match exactly. If the address is not on the list, the person sees Error 400: redirect_uri_mismatch. Where you add it depends on your setup.

Step 1: find out which kind of Google login you have

Lovable's documentation describes two setups for apps on its built-in backend (Cloud). Managed by Lovable is the default: Lovable handles the Google credentials and redirects, and you do not touch Google Cloud Console. Your own credentials means you created an OAuth client in your own Google Cloud project and pasted its Client ID and secret into Lovable.

  1. In Lovable, open More, then Cloud, then Users, then Auth settings, then Google.
  2. Look at which option is selected.
  • Managed by Lovable: Lovable's documentation says no change is needed when you connect a domain. If you still get the error, skip to step 4 and ask Lovable's chat to check the Google sign-in code.
  • Your own credentials: continue with step 2. This is where almost every redirect_uri_mismatch comes from.
  • Your app uses its own Supabase project instead of Cloud: Lovable's documentation says Google sign-in then needs a manual setup outside of Lovable. Go to step 3.

Step 2: your own credentials, fix the redirect URIs

  1. In Lovable, on the Google settings screen, copy every redirect URL it lists. You may see your lovable.app address and each custom domain you added.
  2. Open the Google Cloud Console, pick the project that owns your credentials, and open the OAuth client you created (type Web application).
  3. Under Authorized redirect URIs, add each URL exactly as Lovable shows it. Lovable's documentation says scheme, domain, path and trailing slashes all matter.
  4. Save in Google. Back in Lovable, select the URLs you whitelisted and click Save.

The usual trigger is a new domain. Lovable's documentation says that when you connect a custom domain later, it adds the redirect URL to the list but does not select it, so Google sign-in fails on the new domain until you add it in Google Cloud, select it in Lovable and save.

Two quick checks: http and https are different, and a client of the wrong type (mobile or desktop) does not work with Lovable's redirect flow, according to its troubleshooting notes. I could not find an official figure for how long Google takes to apply a change, so if it still fails right after saving, wait a few minutes and retry in a new private window.

Step 3: your own Supabase project

In this setup the return address is your Supabase project's callback, not your website. Supabase's Google login guide says to create a Web application client and then:

  • Add your site address (for example https://yourdomain.com) under Authorized JavaScript origins.
  • Add your project's callback URL under Authorized redirect URIs. It looks like https://your-project-ref.supabase.co/auth/v1/callback, and Supabase says you can copy the exact value from the Google provider page in its Dashboard under Authentication.
  • Paste the Client ID and Client secret into that same Supabase provider page.

Your site address also has to be allowed in Supabase's Site URL and Redirect URLs, or the person returns to the wrong place after Google. A sketch of the call, to compare with what your project actually contains:

Starting Google sign-in (sketch)
// Sketch for an app that uses its own Supabase project.
// redirectTo must also be in Supabase's Redirect URLs list.
const { error } = await supabase.auth.signInWithOAuth({
  provider: "google",
  options: { redirectTo: `${window.location.origin}/` },
});

Step 4: "Google hasn't verified this app" and blocked testers

This one is about the OAuth consent screen, not the redirect list. Google's help page on app audience says a project whose publishing status is Testing is limited to up to 100 test users listed on the consent screen, and Google shows a warning before a test user continues. Anyone not on the list cannot sign in.

  1. In Google Cloud Console, open Google Auth Platform and find the Audience page.
  2. If the status is Testing, either add each person under test users, or publish the app to move it to production.
  3. If people still see a warning about an unverified app, read Google's note: the Unverified apps warning appears when an app requests sensitive or restricted scopes before it has completed verification. Lovable's documentation says the default scopes are email and basic profile. Check the Scopes list in your project for anything beyond that, and remove what you do not need.

If you only want the screen to show your own name and logo, Lovable's documentation says that is what your own credentials are for. If you do not need that, switching back to Managed by Lovable avoids the Google Cloud setup entirely. Lovable says switching does not affect existing user accounts.

Test the fix

  1. Open your real domain in a private window.
  2. Click Sign in with Google and choose an account that is a test user (or any account, if the app is published).
  3. Check you return to your app signed in, not to an error page.
  4. Repeat on every address you use: the lovable.app one and each custom domain.
  5. Sign out and sign in again to confirm the second visit works.

Related

If email login is the problem instead, see password reset link not working. Once people can log in, check that your data is not public.

FAQ

Do I need a Google Cloud account to add Google login to a Lovable app?

Not for the default setup. Lovable's documentation says Google sign-in on the built-in backend (Cloud) is Managed by Lovable by default, with no Google Cloud Console configuration. You only need your own Google Cloud project if you want your own consent screen branding, custom scopes, or ownership of the credentials.

Why does it work on my lovable.app address but fail on my custom domain?

With your own credentials, Lovable's documentation says it adds a redirect URL for the new domain to the list but does not select it. Add that URL as an Authorized redirect URI in Google Cloud, select it in Lovable and click Save. Until then, Google sign-in fails on the new domain with a redirect URI mismatch error.

How many people can use my app while the consent screen is in Testing?

Google's help page says projects with the Testing publishing status are limited to up to 100 test users listed on the consent screen. Anyone else is blocked until you move the app to production.

Google keeps showing the wrong account. Is that a Lovable setting?

I could not find a Lovable setting for this in its documentation. Google's account chooser is based on the accounts signed in to that browser, so test in a private window and pick Use another account when asked.

Checklist

Still stuck?

Send me the app link and what's broken. The first look is free and you get a fixed quote before I touch anything.

Related guides