Hi. Login with Google works locally, but doesn't work in production. I receive an error: "Access blocked: Authorization Error. The OAuth client was not found. Error 401: invalid_client"
Url: https://accounts.google.com/signin/oauth/error/v2?authError=Cg5pbnZhbGlkX2NsaWVudBIfVGhlIE9BdXRoIGNsaWVudCB3YXMgbm90IGZvdW5kLiCRAw%3D%3D&client_id=undefined&flowName=GeneralOAuthFlow
client_id=undefined - for some reason
I set up env variables in the Settings > Environment Variables: AUTH_GOOGLE_ID and AUTH_GOOGLE_SECRET
I checked a few times whether all the values are correct. I also redeployed the last branch (google-auth) a few times when I tried to solve the problem. Didn't help.
Google console:
-
Authorized JavaScript origins:
https://personal-task-manager-nine.vercel.apphttp://localhost:3000 -
Authorized redirect URIs:
https://personal-task-manager-nine.vercel.app/api/auth/callback/googlehttp://localhost:3000/api/auth/callback/google
I use Auth.js and that's how the env variables look in the code: Google({ clientId: process.env.AUTH_GOOGLE_ID, clientSecret: process.env.AUTH_GOOGLE_SECRET, })
Please, help me to solve this problem. Thank you.