Skip to content
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

fix: prevent signed-in auth view from flashing #572

Merged
merged 1 commit into from
Apr 21, 2023

Conversation

dnsos
Copy link
Collaborator

@dnsos dnsos commented Apr 20, 2023

This PR prevents the /auth route from briefly showing the authenticated state before the user profile appears. We do this by removing the UI and immediately redirecting to /profile once there is a session present.

Steps to reproduce the unwanted behaviour

  1. Sign out
  2. Make sure that no Supabase cookies or localStorage objects are stored in your browser
  3. Sign in

You will briefly see the unwanted UI flashing:

Screenshot 2023-04-20 at 15 09 50

After this change, the problem should be gone!

We now immediately redirect from /auth to /profile once there is a session present
@vercel
Copy link

vercel bot commented Apr 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
giessdenkiez-de ✅ Ready (Inspect) Visit Preview Apr 20, 2023 1:07pm

@dnsos dnsos marked this pull request as ready for review April 20, 2023 13:10
@dnsos dnsos requested review from raphael-arce and removed request for vogelino April 20, 2023 13:11
Copy link
Collaborator

@ff6347 ff6347 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested it locally. Works. Very nice. Thank you

@dnsos dnsos merged commit ed9a520 into feat/auth-via-supabase Apr 21, 2023
@dnsos dnsos deleted the fix/signin-loading-state branch April 21, 2023 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants