© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
13 replies
Sidney

User needs to refresh the page to get logged in after third party auth (Supabase, NextJS)

Hello everyone,
I'm using supabase with next and third party auth. The problem is that my user has to refresh the page to get logged in after using third party auth. I have tried getting the user's data from the client side with supabase methods and useEffect and from the server side with getServerSideProps with supabase methods and sql request but my userState won't update. However I can see the created user token in my localStorage and in the cookies...

This problem occurs only online, when I'm on localhost everything is working. When the user is loggin in with email everything is working. I noticed that the token is persisting in the url when I'm on local, but it flashes then diasapear when I'm online.

Thanks to anyone who could help.
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Auth error after having the user logged
SupabaseSSupabase / help-and-questions
14mo ago
Authenticating third-party services using Supabase Auth
SupabaseSSupabase / help-and-questions
7mo ago
get user function supabase.auth.user()
SupabaseSSupabase / help-and-questions
4y ago
nextjs + supabase auth, how to persist user session?
SupabaseSSupabase / help-and-questions
4y ago