Add activeOrganizationSlug in session data
Is there a way to add the activeOrganizationSlug in the session data, cache it and access it through getSessionCookie or regular auth.api.getSession ?
7 Replies
It's possible to modify a session response (eg for
getSession
), however it's not possible to cache it right now using Better auth if you modified it.
You can take a look at our customSession plugin.So if we use customSession plugin the session caching in cookies does not work anymore ?
Yeah

So customSession would be one of the easiest solution, just may not be the best for your case.
thanks! btw, when you said "right now", it's because it's planned ? or not yet
not yet planned, but on our radar
GitHub
Support caching of modified session data with customSession plugin ...
Is this suited for github? Yes, this is suited for github Is your feature request related to a problem? Please describe. I'm frustrated that when using the customSession plugin to add custom fi...