← All errors · SupabaseSupabase auth errors
Error 400: redirect_uri_mismatch (Google sign-in in a Supabase app)
Exact error
Error 400: redirect_uri_mismatch
What it means
This often shows up in Lovable, Bolt, Cursor, or v0 apps that add Sign in with Google through Supabase. After you click the Google button, Google shows Error 400: redirect_uri_mismatch instead of the consent screen. Google is rejecting the redirect URI that Supabase Auth sent. That URI must be your Supabase project's callback URL, not your app's own URL. Official Sign in with Google docs say to put the callback URL under Authorized redirect URIs in the Google Auth Platform client (Web application), and to copy it from the Google provider page on the Supabase Dashboard. For a hosted project the callback looks like https://<project-ref>.supabase.co/auth/v1/callback (the same format official Sign in with GitHub docs give for every project's Auth callback). For local development, the Google guide specifies http://127.0.0.1:54321/auth/v1/callback. Your app's own URL belongs under Authorized JavaScript origins, and also as the Site URL or redirect configuration in your Supabase project. If the app uses a PKCE flow, for example Server-Side Auth, the redirectTo URL you pass to signInWithOAuth must also be on your project's Redirect URLs allow list (Dashboard: Authentication > URL Configuration).
See also: official Supabase guides: Sign in with Google; Redirect URLs.
Likely causes
- Authorized redirect URIs in the Google client is missing the Supabase callback, or has a typo, a trailing slash, http versus https, or the app URL instead of the callback.
- You are testing against the hosted project but only registered the local callback, or the other way around.
- Authorized JavaScript origins is missing the app's URL (for a site at https://example.com/app, official docs say to add https://example.com). Locally, official docs say to add http://localhost:<port>.
- With PKCE or SSR, redirectTo is not on the Supabase Redirect URLs allow list. That is a separate check from the Google 400, and official docs require it for the app callback to work.
How to fix it
In the Google Auth Platform, open the Web application OAuth client. Under Authorized redirect URIs, add the exact callback URL from the Google provider page in the Supabase Dashboard. For a hosted project official Auth docs say that URL looks like:
https://<project-ref>.supabase.co/auth/v1/callbackIf you are signing in against a local Supabase stack, official Sign in with Google docs say the Authorized redirect URI is:
http://127.0.0.1:54321/auth/v1/callbackUnder Authorized JavaScript origins, add your application's URL, not the Supabase callback. Official docs: if the app is hosted on https://example.com/app, add https://example.com. While developing locally, add http://localhost:<port>, and remove that origin before production. Configure the same URLs as the Site URL or redirect configuration in your Supabase project.
If the app uses a PKCE flow (for example Server-Side Auth with @supabase/ssr), pass a redirectTo URL to signInWithOAuth that points at your app's callback route, and add that same URL to the Redirect URLs allow list (Dashboard: Authentication > URL Configuration):
await supabase.auth.signInWithOAuth({ provider: 'google', options: { redirectTo: 'https://example.com/auth/callback', }, })If Lovable, Bolt, Cursor, or v0 wired up Sign in with Google, paste this so it checks the Google client and the Supabase allow list instead of rewriting the button:
Sign in with Google fails with Error 400: redirect_uri_mismatch. In the Google Auth Platform Web application client, set Authorized redirect URIs to the Supabase callback URL from the Dashboard Google provider page. For a hosted project that is https://<project-ref>.supabase.co/auth/v1/callback. For local development it is http://127.0.0.1:54321/auth/v1/callback. Do not put the app's own URL under Authorized redirect URIs. Put the app URL under Authorized JavaScript origins (https://example.com, or http://localhost:<port> in development). If the app uses PKCE or Server-Side Auth, add the redirectTo URL to Supabase Authentication > URL Configuration Redirect URLs. Do not change the Google button until these URLs match.
Still stuck after trying this? Get it fixed for $49, or you don't pay.
Prevent this next time
- Configure custom SMTP before launch so auth emails are not limited by the built-in test sender.
- Test signup, login, password reset and email confirmation on a staging project after every auth change.
FAQ
What does "Error 400: redirect_uri_mismatch (Google sign-in in a Supabase app)" mean?
This often shows up in Lovable, Bolt, Cursor, or v0 apps that add Sign in with Google through Supabase. After you click the Google button, Google shows Error 400: redirect_uri_mismatch instead of the consent screen. Google is rejecting the redirect URI that Supabase Auth sent. That URI must be your Supabase project's callback URL, not your app's own URL. Official Sign in with Google docs say to put the callback URL under Authorized redirect URIs in the Google Auth Platform client (Web application), and to copy it from the Google provider page on the Supabase Dashboard. For a hosted project the callback looks like https://<project-ref>.supabase.co/auth/v1/callback (the same format official Sign in with GitHub docs give for every project's Auth callback). For local development, the Google guide specifies http://127.0.0.1:54321/auth/v1/callback. Your app's own URL belongs under Authorized JavaScript origins, and also as the Site URL or redirect configuration in your Supabase project. If the app uses a PKCE flow, for example Server-Side Auth, the redirectTo URL you pass to signInWithOAuth must also be on your project's Redirect URLs allow list (Dashboard: Authentication > URL Configuration).
What usually causes it?
Authorized redirect URIs in the Google client is missing the Supabase callback, or has a typo, a trailing slash, http versus https, or the app URL instead of the callback. You are testing against the hosted project but only registered the local callback, or the other way around. Authorized JavaScript origins is missing the app's URL (for a site at https://example.com/app, official docs say to add https://example.com). Locally, official docs say to add http://localhost:<port>. With PKCE or SSR, redirectTo is not on the Supabase Redirect URLs allow list. That is a separate check from the Google 400, and official docs require it for the app callback to work.
How do I fix it?
1. In the Google Auth Platform, open the Web application OAuth client. Under Authorized redirect URIs, add the exact callback URL from the Google provider page in the Supabase Dashboard. For a hosted project official Auth docs say that URL looks like: 2. If you are signing in against a local Supabase stack, official Sign in with Google docs say the Authorized redirect URI is: 3. Under Authorized JavaScript origins, add your application's URL, not the Supabase callback. Official docs: if the app is hosted on https://example.com/app, add https://example.com. While developing locally, add http://localhost:<port>, and remove that origin before production. Configure the same URLs as the Site URL or redirect configuration in your Supabase project. 4. If the app uses a PKCE flow (for example Server-Side Auth with @supabase/ssr), pass a redirectTo URL to signInWithOAuth that points at your app's callback route, and add that same URL to the Redirect URLs allow list (Dashboard: Authentication > URL Configuration): 5. If Lovable, Bolt, Cursor, or v0 wired up Sign in with Google, paste this so it checks the Google client and the Supabase allow list instead of rewriting the button:
Last checked against official docs on . Sources: Supabase docs: Sign in with Google, Supabase docs: Redirect URLs, Supabase docs: Sign in with GitHub (callback URL format).
Related errors
- AuthApiError: Invalid login credentials
- AuthApiError: Database error saving new user
- AuthApiError: Email not confirmed
More Supabase errors and fixes →
Tools that help
- Railway: Deploy backends and databases; new users get $20 credit.
Some links on this page are affiliate links: if you sign up or buy through them, FixStack may earn a commission at no extra cost to you. Learn more.
Get new fixes weekly
No spam. Unsubscribe anytime. Privacy