Closed jasmeetchadha closed 1 year ago
I'm afraid you'll need to provide me with more details about the error you're getting. Can you paste the full error message you get in the terminal/browser dev tools?
Error 400: redirect_uri_mismatch
You can't sign in to this app because it doesn't comply with Google's OAuth 2.0 policy.
If you're the app developer, register the redirect URI in the Google Cloud Console.
Request details: redirect_uri=http://localhost:3000/api/auth/callback/google
I'm seeing the same at Sign in with Google: https://developers.google.com/identity/protocols/oauth2/web-server#authorization-errors-redirect-uri-mismatch
Okay, verify the following:
In google developer console
In .env file
GOOGLE_CLIENT_ID
and GOOGLE_CLIENT_SECRET
, and they are both without quotation marksALLOWED_EMAIL_DOMAIN
is set correctly (this should not be your email, but a domain like @google.com, @yahoo.com, etc.)NEXTAUTH_URL
is equal to http://localhost:3000
I had all set accordingly, but I reset and reentered all. That solved it for me, thank you.
I'll probably publish a branch with all features except for google auth at some point in the near future to make the set-up easier for those who don't intend on deploying the app
I was missing this:
in the credentials section, 'Authorized redirect URIs' should be set to http://localhost:3000/api/auth/callback/google
Now it works. Perhaps, worth adding it in the Auth0 section!
Will update shortly, thanks!
Perhaps this is a lame question - How do I fix this?