NextAuth redirect URI mismatch when using custom API path /api/v1/auth #13268
Unanswered
akashdeep023
asked this question in
Help
Replies: 1 comment
|
The config you've got (full path in
If all three check out and it's still sending I built a free client-side tool that diffs whatever redirect_uri your app actually sends against your Google Cloud Console entries byte by byte, handy for confirming exactly which layer is still wrong once you've ruled out the above: https://arling.sk/google-oauth-redirect-doctor/ |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I’m using NextAuth.js with a custom base path
/api/v1/auth.Everything works perfectly in local development, but in production (Vercel) I get a Google OAuth error:
redirect_uri_mismatcheven though the redirect URL in the Google Cloud Console matches exactly what NextAuth generates locally.Environment
next-auth@4.24.11.env
app/provider.ts
File structure
/app/api/v1/auth/[...nextauth]/route.tsExpected Behavior
Google OAuth should redirect correctly to:
https://mydomain..vercel.app/api/v1/auth/callback/googleActual Behavior
After sign-in, the redirect URL generated by NextAuth is:
https://mydomain..vercel.app/api/auth/callback/googleImages



All reactions