[next-auth][error][JWT_SESSION_ERROR]
auth code here : https://paste.gg/p/anonymous/64f72742fab84547a08a8910e8358580
Solution:Jump to solution
Read the error message. It has
1) Link to the page in the docs you need
2) A place in the file where this error occurred (auth.ts line 106)
3) What the error is (You did
something.id
, when something
is undefined
)...5 Replies
Solution
Read the error message. It has
1) Link to the page in the docs you need
2) A place in the file where this error occurred (auth.ts line 106)
3) What the error is (You did
something.id
, when something
is undefined
)it's weird there's nothing in line 106
yeah, I looked at the error before I posted the outline 106. There's nothing.
I'm facing the same error, noticed that it's produced on the jwt callback but still don't know why or how to solve it
if you try to console.log the user.id value inside the jwt callback it's shown as undefined and that is what it's causing the error
the weird thing is that if I change the strategy to 'database' everything works fine but that does not allow me to use the credentials provider
my error message is mentioning an empty line in my code as well and that also weirds me out a bit
Try passing "secret" property which explicitly points to your NEXTAUTH_SECRET env variable inside authOptions object inside auth.ts file. Like this, secret: process.env.NEXTAUTH_SECRET. Doing this solved this error for me & all callbacks work properly with jwt stratergy.