© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago
meaw3939

Session from `supabase.auth.exchangeCodeForSession()` not persisting

Hi there! I am using Supabase Oauth with google, redirecting to my callback URL and can see the right session/user following: https://supabase.com/docs/guides/auth/auth-helpers/nextjs#managing-sign-in-with-code-exchange. However, when redirecting to my requestUrl.origin, I try to get the session using supabaseServerClient.auth.getSession(); but receive an empty session.

My email/pwd flow works fine with signInWithPassword. please help thank you
Supabase Auth with the Next.js App Router | Supabase Docs
Authentication and Authorization helpers for creating an authenticated Supabase client with the Next.js 13 App Router.
Supabase Auth with the Next.js App Router | Supabase Docs
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
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Supabase.auth.exchangeCodeForSession doesn't persist session
SupabaseSSupabase / help-and-questions
3y ago
Supabase Auth Session Not Persisting Across Page Refresh/Navigation
SupabaseSSupabase / help-and-questions
6mo ago
supabase.auth.session() Error
SupabaseSSupabase / help-and-questions
4y ago
React Native (Expo) - Auth session not persisting after moving to supabase.js v2
SupabaseSSupabase / help-and-questions
4y ago