© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•14mo ago•
8 replies
Gus

how do I get a session after confirming a user's email?

Hey, I'm kind of lost looking at the auth / swift docs.

I'm calling supabase.auth.signUp(email: email, password: password, redirectTo: redirectUrl), and clicking the link in the email sent to the user redirects to my app URL with the query parameter code=<some UUID>.

From looking at the docs, the signUp method doesn't return a session when confirm email is enabled, and sure enough I get an null session error later in my flow after the user is redirected to my app.

It's unclear from the docs what I'm supposed to do with the code sent in the redirect URL. I thought I was doing Implicit flow, but the PKCE docs mention just receiving a code parameter in the redirect URL.

I saw PKCE docs mention supabase.auth.exchangeCodeForSession(authCode: ). I'm guessing I should pass the code in the URL to that, but it's unclear what I'm supposed to do with the Session returned by this method.

any advice would be greatly appreciated. thanks!
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

How to update other user's email
SupabaseSSupabase / help-and-questions
5mo ago
How do I get an email whenever a supabase hackathon starts?
SupabaseSSupabase / help-and-questions
3y ago
How to authenticate user session after 3rd party redirect?
SupabaseSSupabase / help-and-questions
3mo ago
How can I update another user's email in Supabase while requiring email confirmation?
SupabaseSSupabase / help-and-questions
3mo ago