-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flash of LoginComponent on Page Load Due to Initial Null User State #19
Comments
current idea: we decouple token/url and email/password? make it sort of a two step? that way we set up the supabaseClient before needing to do auth, maybe this way we can use the auth helpers Supabase provides? @adamcohenhillel thoughts if that could help? Might not fix the flashing at first but maybe once we can assume there is the supabaseClient it would make auth cleaner no? |
In my testing the flash still exists even with the loading check 🤔 |
First login is always fine, then if you reload or come back while logged in it flashes. So maybe that's the real edge case to test |
When the page loads, there is a brief flash of the LoginComponent before the user's authentication status is confirmed. This occurs because the initial state of the user in our authentication hook is set to null, and it takes a moment for the hook to update this state based on the user's session. This flash can be jarring and confusing for users who are already logged in.
Steps to Reproduce
Open the application while already logged in.
Observe that the LoginComponent briefly appears before being replaced by the main content.
Expected Behavior
The LoginComponent should not appear if the user is already authenticated and has an active session.
Actual Behavior
The LoginComponent flashes briefly on page load, even when the user is authenticated.
The text was updated successfully, but these errors were encountered: