#NextAuth is not working in the deployed NextJS application.

17 messages · Page 1 of 1 (latest)

loud axle
#

I'm facing an issue with my Next.js 13 application deployed on Vercel, which utilizes Firebase as the backend and Next-Auth for authentication, specifically using the Google provider. During development, I set the authorized redirect URL in the Google Cloud Console as "http://localhost:3000/api/auth/callback/google", and everything worked fine. However, when deploying the application to production and updating the authorized redirect URL to "https://cloud-storage-mu.vercel.app/api/auth/callback/google", I encountered a "Server error - There is a problem with the server configuration" message when attempting to sign in with Google.

Additionally, I've used the "cloud-storage-mu.vercel.app" from my deployed application's url. If it is wrong, How to set the production url in the above case ?

Any help on this would be appreciated.

warped elmBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

      🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in <id:customize>

      ✅ You can mark a message as the answer for your post with `Right click -> Apps -> Mark Solution`
      (if you don't see the option, try refreshing Discord with Ctrl + R)
restive leaf
loud axle
#

Where to check this server log ?

restive leaf
loud axle
#

This is what I'm getting

#

And I checked it. It's the same secret as in the Google Cloud Console. 🥲

restive leaf
loud axle
#

But still getting the same error

restive leaf
#

as in, set the env variable in this section

#

also please rotate your secrets asap

#

these are secrets, not supposed to be pushed to github or posted in a public server like this

loud axle
#

It's working now

#

Thanks a lot. Is Client keys are necessary for every deployment ?

restive leaf
#

keep it the same between deployments i.e. you shouldn't set a new secret every time you deploy