How to return additional fields from user in session callback next-auth?
Hi all!
I have the following schema:
Everything is working as it should in that aspect.
In the callback:
That console log only includes fields such as name, email, image, id and role. I want it to be able to include user.buyer or user.seller for example, or any field for that matter. How can I do this? Please post your thoughts/ideas!
5 Replies
on same issue aswell
and console logging the session doesnt include the seller and buyer?
oh im blind
what is Seller and Buyer, enums?
oh is not
im confused wtf is a Seller type
why was this even recommended its from a long ass time ago
RIiiiiight...
so basically i fixed it
my issue was that google auth when making a custom adapter
wouldnt return all of the stuff i wanted
next auth as i noticed, is kinda opinionated on the data it returns once authed
i wish there was an option to choose what data comes through when authed, because right now by default you only get name
but if you want to separate name and surname, youre shit out of luck
![](https://utfs.io/f/ce4f9c0a-645e-4dd5-a4e7-af48bf9c6842-1nq2cb.png)
in next auth, i added an additional thing to make it return family name aswell.
fixed my issue as i wanted to have both names separated