Google Auth, Vercel hosting #1580
-
Hello folks Could you please give some advice on how to handle such a situation? I create a small next app and made production deployment at this URL - https://comtel-inventory.vercel.app. Inside of app I have to use Google authentication of users with the Next-Auth library. On the google console, I provide such authorized redirect URI but when I try to login I see 400 error on google OAuth consent screen: redirect_uri_mismatch - The redirect URI in the request, https://comtel-inventory-6ohmho13d-olegpuzankin.vercel.app/api/auth/callback/google this is one of my deployment URLs - comtel-inventory-6ohmho13d-olegpuzankin.vercel.app Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Did you set your |
Beta Was this translation helpful? Give feedback.
-
This is how the const { basePath, baseUrl } = parseUrl(process.env.NEXTAUTH_URL || process.env.VERCEL_URL) Make sure you use that env variable on the production build |
Beta Was this translation helpful? Give feedback.
This is how the
baseUrl
is gets his value. What you have there is theVERCEL_URL
Make sure you use that env variable on the production build