You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a problem with the way the profiles are used in the session init.
The problem is two-fold :
profiles are loaded by default on session init, and set in a state that is part of the SessionContext. However these profiles are not exposed by the useSession hook, making them useless, and therefore wasting an HTTP request on login :
the skipLoadingProfiles flag can be used to remove that behaviour. However, it turns out the profile state is the only variable that triggers a session context update when logging out (the session object does not get updated by a logout, only its internal isLoggedIn field)
So trying to disable the profile loading actually disables the logout updates one can expect from a SessionProvider, thereby mandating the explicit use of an onLogout callback.
Expected result
have the profile exposed through the useSession hook
be able to use skipLoadingProfiles while relying SessionProvider to trigger proper updates on logout
Additional information
Tested with 3.0.0
The text was updated successfully, but these errors were encountered:
Search terms you've used
profile, logout
Bug description
There is a problem with the way the profiles are used in the session init.
The problem is two-fold :
solid-ui-react/src/hooks/useSession/index.tsx
Lines 37 to 47 in 52cbbc4
skipLoadingProfiles
flag can be used to remove that behaviour. However, it turns out the profile state is the only variable that triggers a session context update when logging out (the session object does not get updated by a logout, only its internalisLoggedIn
field)solid-ui-react/src/context/sessionContext/index.tsx
Lines 190 to 200 in 52cbbc4
So trying to disable the profile loading actually disables the logout updates one can expect from a SessionProvider, thereby mandating the explicit use of an
onLogout
callback.Expected result
useSession
hookskipLoadingProfiles
while relying SessionProvider to trigger proper updates on logoutAdditional information
Tested with 3.0.0
The text was updated successfully, but these errors were encountered: