Return customized user object in authorize() callback #9241
Unanswered
TeoColuccio
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to use next auth on nextjs to manage authentication using Google and using email and password (using signInWithEmailAndPassword from firebase), but I'm having problems in returning the user object that I need. In fact, it looks like the user object, inside the session object, consists of name, email and image, that for logging in using Google that's fine, however when I handle logging in with email I would like to return the ID as well... This is what I am trying to do in the file "src/app/api/auth/[...nextauth]/route.ts":
At first I didn't use the callback attribute, thinking it would change "user" automatically, but using it I realized that the user in the session() parameters is not my user with the id.
Finally, I also tried redefining the Session interface, but again, nothing changed.
What can I try?
Beta Was this translation helpful? Give feedback.
All reactions