Next.js Discord

Discord Forum

Next-Auth hosting to vercel.

Unanswered
Verin posted this in #help-forum
Open in Discord
Avatar
VerinOP
next-auth use the credentials and google OAuth, both of them works well on local pc.
After deploying it to the vercel, I've got this error.
What the problem is?

16 Replies

Avatar
Plott Hound
what is the error?
did you correctly set the env vars on vercel?
eg in your local dev env it would be something like this:

AUTH_URL="http://localhost:3000"
AUTH_SECRET="localsecret"


and in prod it would be:
AUTH_URL="http://mydomain.com"
AUTH_SECRET="prodsecret"
also you need to make for each auth provider eg github you have two apps, one for dev and one for prod since the callback url will be different for each
Avatar
VerinOP
oh yes?
Will you guide via screen?
Avatar
Plott Hound
no im at work sorry
did you check my suggestions?
Avatar
VerinOP
Wrong?
Image
Avatar
Plott Hound
Looks right to me
Avatar
VerinOP
This is working well on local but not on the host.
Image
Avatar
Plott Hound
What are the actual errors you are getting?
Avatar
VerinOP
next-auth signin is not working.
Image
Google OAuth is not working too.
This is Gmail Auth result
Image