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

SignUp return both Session and User #18

Closed
fplaras opened this issue Dec 29, 2021 · 5 comments
Closed

SignUp return both Session and User #18

fplaras opened this issue Dec 29, 2021 · 5 comments

Comments

@fplaras
Copy link

fplaras commented Dec 29, 2021

There is a use case in the documentation that indicates either object is returned based on email confirmation requirement but the current signup() only returns the Session object.

Ref: https://supabase.com/docs/reference/javascript/auth-signup

const { user, session, error } = await supabase.auth.signUp({
  email: 'example@email.com',
  password: 'example-password',
})

I am thinking it could return a Tuple that includes the User and Session objects.

@acupofjose
Copy link
Collaborator

acupofjose commented Dec 29, 2021

@fplaras To clarify - A Session includes the User as a property - is that different than what you're asking?

@fplaras
Copy link
Author

fplaras commented Dec 29, 2021

@acupofjose yes, because when a user is signed up and their email is not confirmed(with requirement) session is null but if I could retrieve the user data that was created I can insert for example user profile records that reference the new user uuid but if the session is null I would have to wait for the email confirmation to go through to then retrieve the user based on the access token to then create the profile and insert profile records.

@acupofjose
Copy link
Collaborator

Ah! I see - I'll look into it, let me make an issue on the Gotrue page

@acupofjose
Copy link
Collaborator

acupofjose commented Dec 29, 2021

@fplaras Session will now be returned with null token data but a populated User property. Available in gotrue-csharp@2.3.3 and supabase-csharp@0.2.12.

@fplaras
Copy link
Author

fplaras commented Dec 29, 2021

@fplaras Session will now be returned with null token data but a populated User property. Available in gotrue-csharp@2.3.3 and supabase-csharp@0.2.12.

Sweet! Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants