Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Sign up user without creating session #1063

Open
maxfornacon opened this issue Oct 14, 2024 · 1 comment
Open

Feature request: Sign up user without creating session #1063

maxfornacon opened this issue Oct 14, 2024 · 1 comment
Labels
auth This issue or pull request is related to authentication blocked This issue is blocked by another issue enhancement New feature or request

Comments

@maxfornacon
Copy link

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.

@maxfornacon maxfornacon added the enhancement New feature or request label Oct 14, 2024
@Vinzent03 Vinzent03 added the auth This issue or pull request is related to authentication label Oct 15, 2024
@dshukertjr dshukertjr added the blocked This issue is blocked by another issue label Oct 16, 2024
@dshukertjr
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth This issue or pull request is related to authentication blocked This issue is blocked by another issue enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants