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
Hi! Thanks so much for putting Supabase together—it's been a joy to be able to get an app running so quickly.
I've wrapped an AuthContext around my app because I want to be able to show certain sections of the app even when users aren't logged in. The AuthContext looks like this:
This works well when users first log in or sign out. However, after the page is reloaded when users are logged in, we run into a couple of issues:
The supabaseClient.auth.getSession() function seems to fail to call in the updateSessionState call. There are no outgoing API requests, nor are there any errors. We are never able to reach the block inside the if(session) statement inside updateSessionState.
Weirdly enough, when the auth state change listener is activated, setSession(session) does work and the session is set to what we would expect—with the correct access token from local storage
However, in the auth state change listener call we see the same issue with supabaseClient.auth.getUser() as with supabaseClient.auth.getSession() in updateSessionState—no outgoing API calls, no errors, just stalled.
My housemate and I guess that there's probably something we're not understanding about how the code works, or how it might interact with the browser upon reload—any pointers would be so appreciated!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! Thanks so much for putting Supabase together—it's been a joy to be able to get an app running so quickly.
I've wrapped an
AuthContextaround my app because I want to be able to show certain sections of the app even when users aren't logged in. TheAuthContextlooks like this:This works well when users first log in or sign out. However, after the page is reloaded when users are logged in, we run into a couple of issues:
supabaseClient.auth.getSession()function seems to fail to call in theupdateSessionStatecall. There are no outgoing API requests, nor are there any errors. We are never able to reach the block inside the if(session) statement insideupdateSessionState.setSession(session)does work and the session is set to what we would expect—with the correct access token from local storagesupabaseClient.auth.getUser()as withsupabaseClient.auth.getSession()inupdateSessionState—no outgoing API calls, no errors, just stalled.My housemate and I guess that there's probably something we're not understanding about how the code works, or how it might interact with the browser upon reload—any pointers would be so appreciated!
Beta Was this translation helpful? Give feedback.
All reactions