supabase / supabase-flutter

Flutter integration for Supabase. This package makes it simple for developers to build secure and scalable products.
https://supabase.com/
MIT License
745 stars 184 forks source link

Feature request: Sign up user without creating session #1063

Open maxfornacon opened 1 month ago

maxfornacon commented 1 month ago

Is your feature request related to a problem? Please describe. In my use case I want users to sign up, but not get signed in immediately. My application reacts on the AuthChangeEvent, but needs data from the DB that's not immediately present at the time when signUp is called.

Describe the solution you'd like A possible solution could be adding a createSession parameter. Devs could decide if a session will be created after sign up.

await Supabase.instance.client.auth.signUp(
        password: password,
        email: email,
        createSession: false
    );

Because login credentials are still present I could just call signInWithPassword() after all processing is done to get the session.

Describe alternatives you've considered Another solution for my user case would be passing a UUID to the signUp method so that I could prefill my user table with all necessary data and then call signUp but assign a self chosen ID to the AuthUser.

I could also create a user with an edge function, but that seems to be unnecessary overhead.

dshukertjr commented 1 month ago

Thanks for the suggestion. Currently, our auth server will create a session when the user signs up, so there needs to be an update on the backend for this feature to land.

There has been requests for this feature, so we will update supabase-flutter once the server side is ready.