© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
11 replies
figment

getSession initially returns null session, which leads to incorrect rendering

Hi all, I'm using supabase-js with react, and have a user avatar/login button being conditionally rendered in the navbar based on if the session exists for a logged in user. However, getSession initially returns null before getting the session, which means the login button is shown before quickly changing to the avatar anytime the user goes to a different view.

How can I resolve this?
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

getSession returns null on the server
SupabaseSSupabase / help-and-questions
4y ago
data.session from supabase.auth.getSession() is always null.
SupabaseSSupabase / help-and-questions
4y ago
getSession() is null after login?
SupabaseSSupabase / help-and-questions
3y ago
getSession() return null after login
SupabaseSSupabase / help-and-questions
4y ago