Skip to content

Session/User augmentation not working #7033

Closed Answered by krinklesaurus
krinklesaurus asked this question in Help
Discussion options

You must be logged in to vote

Ok I got it finally working (and I admit I feel a little stupid).

In my jwt callback method I had arguments

https://github.com/krinklesaurus/next-auth-test/blob/bc03bcd5db483bce64a36e26f9208bb0bff2338e/pages/api/auth/%5B...nextauth%5D.js#L14

which were wrapped in {}. So a JS object with properties token, account, and profile. Coming from Java, I naturally expected the 2nd parameter to be the user and just did not see the {}. I thought account is the user but with a different parameter name here. That's the stupid part.

The callback had the user object under property user though, so I had to change this to

https://github.com/krinklesaurus/next-auth-test/blob/19614f75fc39d1d7c1d587bdc81f23e…

Replies: 10 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@krinklesaurus
Comment options

@balazsorban44
Comment options

@krinklesaurus
Comment options

Comment options

You must be logged in to vote
1 reply
@Frikki
Comment options

Answer selected by krinklesaurus
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
question Ask how to do something or how something works TypeScript Issues relating to TypeScript
6 participants
Converted from issue

This discussion was converted from issue #7015 on March 22, 2023 15:37.