Adding fields to next-auth session object with module augmentation

I'm trying to add an additional field to the next-auth session object. Having looked at the prisma logs (see pics) I can see this field is being read from in the prepared statement, however the session object being returned is of the default structure, and is not returning the additional fields specified in the interface
No description
No description
No description
1 Reply
Giddeon Scott
Giddeon Scott9mo ago
For anyone having the same issue, I've found this has just recently been fixed by the developer in a recent PR and should be included in the release soon: https://github.com/nextauthjs/next-auth/pull/9712
GitHub
feat: expose full session in session callback by balazsorban44 · Pu...
This PR forwards the entire AdapterSession to the session callback. Instead of limiting the user's callback by filtering out the default values, we can rather pass them the full object, and onl...
Want results from more Discord servers?
Add your server