© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
26 replies
octe

Create session for user in backend

I'm working on migrating from firebase auth to supabase auth. I would like to do it seamlessly for the existing users. I've synced all users to supabase already.

Right now I've created a backend endpoint where authenticated firebase users can retrieve an access token for their corresponding supabase user generated with the jwt secret. This works until the token expires, which i have to manually detect and then fetch a new access token.

I would like for the supabase client to refresh the token by itself, but for that to work I would need a refresh token, right? It doesn't seem possible to create one for a specific user through the admin api. Another option seems to be to use the auth.admin.generateLink function and then create a proper session from that. But that function requires an email and some of my users only have phone numbers. Any ideas?
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

Why do I need a session in the backend?
SupabaseSSupabase / help-and-questions
13mo ago
Cannot create user
SupabaseSSupabase / help-and-questions
3mo ago
offline user session (not storage)
SupabaseSSupabase / help-and-questions
15mo ago
Supabase for Backend
SupabaseSSupabase / help-and-questions
5mo ago