Skip to content

Why Next-auth Session Not Containing the user data(like email, name etc) after Login #11272

Discussion options

You must be logged in to vote

Firstly, I am not sure why I am encountering this error. I did everything correctly. However, when I looked closely, I realized that you need to specifically return the data like this:

return { id: user._id.toString(), name: user.name, email: user.email };
This worked for me.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by EasyCodingTutorial
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