NextAuth won't let me include custom username in jwt callback
Unanswered
Barbary Lion posted this in #help-forum
Barbary LionOP
I am attempting to include the username in my token so I can use it with the session data, but it doesn't seem to want to let me include it. I created the next-auth.d.ts file and am still seeing no success. When I print the user object to the console it prints the proper data including the username so I don't see why I can't pass it here. I'm using the credentials provider. Thanks for the help in advance!
3 Replies
Barbary LionOP
bump 🙏
Sun bear
I think you have to add username to the types
User
and AdaptUser
like you did for Session and TokenBarbary LionOP
Hmm ok, will give that a shot tomorrow. Thanks for the idea.