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
Ping
Ping3mo ago
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.
Arthur
ArthurOP3mo ago
So if we use customSession plugin the session caching in cookies does not work anymore ?
Ping
Ping3mo ago
Yeah
No description
Ping
Ping3mo ago
So customSession would be one of the easiest solution, just may not be the best for your case.
Arthur
ArthurOP3mo ago
thanks! btw, when you said "right now", it's because it's planned ? or not yet
Ping
Ping3mo ago
not yet planned, but on our radar
Arthur
ArthurOP3mo ago
created an issue related to this
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...

Did you find this page helpful?