Google sign-in blocks users? Check Testing
You added "Sign in with Google" to your site, tried it yourself, and it worked. A week later a friend, a tester or your first real customer tells you the button does nothing useful. They get a Google page saying access is blocked, or an error about a redirect, or they sign in once and then get logged out a few days later. This is one of the most common ways login quietly breaks on sites built with Lovable, Bolt, Replit, v0 or Cursor, and it is almost always a setting in Google Cloud, not a bug in your code.
The symptom
Typical reports look like this:
- An "Access blocked" page saying the request is invalid, or "Error 403: access_denied" when someone else tries to sign in.
- "Error 400: redirect_uri_mismatch" on the live domain, even though login worked in the builder's preview.
- Users can sign in, but sessions that depend on Google access stop working after about a week.
The cause
When you create OAuth credentials in Google Cloud, Google also creates an OAuth consent screen for your project. With the External user type it starts in the Testing publishing status. In Testing, only the Google accounts you list as test users can sign in. Everyone else is refused. Google's documentation also says that, in Testing, refresh tokens expire after seven days unless your site only asks for basic scopes like name, email and profile. Your own account was added automatically, or you added it while setting up, which is why you never see the problem.
The second common cause is the redirect. Google only sends people back to URLs you have listed exactly under Authorized redirect URIs. If you moved from a preview URL to a custom domain, or your auth provider uses its own callback URL, a missing or slightly different entry produces redirect_uri_mismatch.
Step-by-step diagnosis
- Test with an account that isn't yours. Open a private window and sign in with a Google account that has never touched the project. If it fails and yours works, the consent screen is the first suspect.
- Read the exact error. Click the error details link on Google's page.
access_deniedpoints at test users or publishing status.redirect_uri_mismatchshows the redirect URL that was sent, which you can compare with your list. - Check the publishing status. In Google Cloud, open the OAuth consent screen (in newer consoles this lives under Google Auth Platform, in the Audience section) and see whether it says Testing or In production.
- Compare the redirect URIs. Open the OAuth client under Credentials. Every URL must match character for character, including
https, the domain, the path and any trailing slash. - Check which credentials the live site really uses. Make sure the client ID in your live environment is the one you just inspected, not an old test client.
Fixes per builder or host
Supabase auth (common with Lovable and Bolt)
With Supabase, Google redirects to Supabase first, then Supabase sends the user to your site. The Google redirect URI should be your project's callback, which looks like https://<project-ref>.supabase.co/auth/v1/callback. Your live domain belongs in Supabase's own Site URL and redirect allow list, which we covered in login emails pointing to localhost. Add your live domain to Authorized JavaScript origins in Google too.
Firebase Auth
Firebase keeps its own list of authorized domains in the Authentication settings. Add your custom domain there as well as in Google Cloud, or sign-in will fail only on the live site.
Auth.js or NextAuth (common with v0 and Cursor projects on Vercel)
The callback is usually https://yourdomain.com/api/auth/callback/google. Add one for each domain people actually use, and make sure the site's base URL setting for production points at the live domain, not a preview URL.
Replit and other hosts
If you use your own Google client, add the deployment's URL and any custom domain as separate redirect URIs. The workspace preview URL and the deployed URL are different, so one entry is rarely enough.
Leaving Testing mode
Once your branding and links are filled in, change the publishing status so it moves to In production. If you only ask for basic scopes, this is usually quick. If you request sensitive scopes, such as Gmail or Drive access, Google may require verification first, so only ask for what you really need.
How to verify
- Sign in from a private window with a fresh Google account, on the live domain, not the preview.
- Try every domain people use, for example with and without
www. - Sign out and back in, and confirm you land on the live site, not localhost or a preview URL.
Prevention
- Keep a short checklist for every new domain: Google redirect URIs, JavaScript origins, and your auth provider's allow list.
- Never test login only with the account that created the project.
- Re-test sign-in after you change domains, hosts or auth settings.
