nextAuth - Add to the user model
https://next-auth.js.org/adapters/models
Hello, I'd like to add modify the user before it comes into the session callback in [..nextauth]
I found this but the authorize method never gets called:
https://stackoverflow.com/questions/71185287/pass-more-data-to-session-in-next-auth
is it a bad idea to overoptimze this and i should just make an extra prisma call here?
Models | NextAuth.js
NextAuth.js can be used with any database. Models tell you what structures NextAuth.js expects from your database. Models will vary slightly depending on which adapter you use, but in general, will look something like this. Each adapter's model/schema will be slightly adapted for its needs, but will look very much like this schema below:
Stack Overflow
Pass more data to session in Next-auth
We are doing OTP auth in our website. So in order to get authorized, a visitor enter his phone number in input and we send him a OPT number and he again enters the sent opt, then if it matches, we ...
14 Replies
as far as i am aware, the link you have posted is the only correct way of doing it. If you need to pass any more data to the nextAuth callback, use jwtToken as mentioned
hmm @shiroyasha_ but it doesnt work...
the authorize debugger never fires
and if i move authorize out
it also never fires
@fotoflo this callback seems to have been renamed from authorize to signIn. Please check that once.
the official docs for the same: https://next-auth.js.org/configuration/callbacks
Callbacks | NextAuth.js
Callbacks are asynchronous functions you can use to control what happens when an action is performed.
OOOOOOOO
thank you! @shiroyasha_ !
but it doesn't work
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
@Geezer: i think it just has to return truthy/false - if i trutn the onSignin like this, its truthy so it goes on to execute session()
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
REALLY!?
HAHHA ok let me check
profile is a callback inside all of the providers?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View