How to modify useSession data type?
I am using credentials and providers then returning user, I was trying to put some user infos into session but session.user always returning
37 Replies
id is a field that create-t3-app adds to the session. look in
[nextauth].ts
and next-auth.d.ts
to see how we do it, you can do the same for any other data
that being said be careful with this - only send stuff to the frontend that you're ok with the user seeingI did a lot of changing on that type file
Nothing happened 😄
it should return only id right?
It is returning the same type of object
this is where I log
the interface doesn't determine what is returned
it's just a typedef
types don't exist at runtime
Yes exactly
I couldnt find where I modify returnin object
you already posted it 😉
the session callback
That made me confuse 😄
theres probably a nicer way to write it but this works
I am wondering
"Logged in as" doesn't show a name because it's not being passed anymore