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?
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?