Hello, I am trying to implement tenant based autho...
# ask-a-descoper
j
Hello, I am trying to implement tenant based authorization in my react-admin site and I'm having some issues. My end goal is to allow users to have multiple tabs open with multiple active sessions viewing different tenants. I've been running into issues here, and could use some advice I found an undocumented prop on the AuthProvider component ('customStorage') - I am passing sessionStorage into this prop so descope stores tokens in sessionStorage instead of local storage. But now I am running into an issue where the descope widgets (<UserProfile> for example) are not using sessionStorage to fetch the token - and the request is going through with an invalid token that is not in sessionStorage. Is there a way to make these widgets use sessionStorage to fetch the token? Or is there a different approach that would be better to achieve my end goal?
b
From what I’m seeing so far, when you pass
sessionStorage
via
customStorage
, the React SDK uses that for your app logic, but the built-in widgets (like
<UserProfile />
) still read from the default Descope session storage (localStorage/cookie). That probably why they’re picking up a different/older token than the one you see in
sessionStorage
. I’m checking internally whether there’s a supported way to have the widgets honor
customStorage
, or if the recommended pattern for multi-tenant React-Admin is a single Descope session per browser + per-tab
currentTenant
handled in app state/backend auth. Docs with some more info: • https://docs.descope.com/client-sdk/descope-components • https://docs.descope.com/management/tenant-management
gratitude thank you 1