Skip to content

Next Auth works on Localhost but not after deployment on vercel #12470

Closed Answered by Swanand-Wagh
Swanand-Wagh asked this question in Help
Discussion options

You must be logged in to vote

I Solved it. I'm able to get the token in the middleware now by doing the following:

const token = await getToken({ req, secret: process.env.AUTH_SECRET, secureCookie: true, cookieName: process.env.NODE_ENV !== 'production' ? 'authjs.session-token' : '__Secure-authjs.session-token', });

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Swanand-Wagh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
1 participant