Missing field in session object with drizzle adapter
I'm using BetterAuth with the drizzle adapter in my next.js application and have added a custom
here's my code for auth:
and here's my code for authClient:
isAdmin field to my user schema. Despite the field existing in my database and configuring additionalFields in BetterAuth, session.user does not include isAdmin when I log it. I've also attempted to use the inferAdditionalFields plugin on the client side, but it still doesn't appear in the session object. I'm looking for a solution to correctly include isAdmin in the session data.here's my code for auth:
and here's my code for authClient:


Solution
Don't put the additional fields in the schema.
It should be at the
Here is how it should be:
It should be at the
betterAuth level.Here is how it should be: