4 Replies
you can use hook
We don't recommend putting all of the users orgs in the session. Like what nikatune said, using a hook would be better.
If you really need to for whatever the reason may be, you can take a look at our custom session plugin
Session Management | Better Auth
Better Auth session management.
i need to validate in the trpc middleware based on passed id
and dont know if its better to store that in the session or check permissions on the middleware
Yeah just make the nessesary DB requests based on the session info to check if they have permission to do whatever