Next Auth not working in production only
Hey 👋 My auth with Github and Google works great on my dev env, but after deploying my project to Vercel, Next Auth stop working correctly. When I use a provider like Github, I get the error
Try signing in with a different account.
and in the URL the error is signin?error=Callback
.
I created 2 apps for OAuth with Github, one for my dev env (redirecting to localhost) and one for the production (redirecting to my Vercel domain). I followed the Next Auth deployment, so I added a secret in my env vars and link it to the secret param in my config.
I don't understand why I'm getting this error only on production and not in development 🧐
My repo is here : https://github.com/armandsalle/vote-design
The deployed code is here : https://vote-design.vercel.app/ (it's still WIP)Vote.design
Vote.design
9 Replies
Do you have any logs when you try to log in? Even just the function logs in Vercel should do; might highlight a more specific error.
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Is this what you want?
Yes, does it have any other messages? Try hitting the errors tab.
It works with my other GH account, I didn't think about testing that!!
Yes I revoke my account, but it didn't fix it. I have the problem only with my GH and Google account. Maybe I login too much?
the errors tab is awaiting new requests but never stop
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Yes, I think too, I will try again tomorrow. Thank you very much for your time and your answers 🙌
did you solve this, im having the same error
Yes, I clear my sessions + user + token tables