Next.js Discord

Discord Forum

JWT callback user always returns undefined

Answered
Pixiebob posted this in #help-forum
Open in Discord
PixiebobOP
In my authorize function im getting the user object from my db and returning it. From my understanding it would then go to the JWT callback where i want to add the user.id from my db to the token, however the user object is always undefined. Is there something im doing wrong? I honestly cant find anything onling anywhere
Answered by Pixiebob
Wow, i post this here and realized my console log in the JWT callback is after the return, no wonder im never seeing it as anything other than undefined. Never getting that hour back
View full answer

3 Replies

PixiebobOP
Wow, i post this here and realized my console log in the JWT callback is after the return, no wonder im never seeing it as anything other than undefined. Never getting that hour back
Answer
PixiebobOP
Yes it is