auth.api.getSession() returns unknown for user and session
Package: [email protected]
I'm using better-auth with Drizzle ORM, and although the system works correctly at runtime, the types I get from auth.api.getSession() are not as expected.
The inferred type is:
const session: {
session: unknown;
user: unknown;
} | null
š Could you confirm if this is expected? Or if there's a way to have the types automatically inferred from the adapter?
5 Replies
Can I see your auth config?
Unrelated to your issue, but are you sure you setup the
schema
correctly? Normally we don't pass the user
schema direct like thatJust copied your auth config, and looks fine to me š¤

the server works fine.
sorry it was my fault in the config I had plugins: []
can't be without plugins