-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
User data not in returned user object #45
Comments
@awalias where did you get this one from? We are returning We also return |
@kiwicopple I got same behaviour when I was playing around with this example. I was trying to destructure |
@kiwicopple I just ran into this with As an example, I just ran this: const res = await supabase.auth.signUp({ email, password });
console.log("res", res); and the output looks like (in devtools): Basically I think there's a mismatch in |
OK it looks like GoTrue returns a full session if there is no email confirmation And only the user object if you have email confirmations on: I added a PR here, will merge tomorrow if there are no other comments |
Hey @kiwicopple, I have just tried to use |
@kiwicopple I wonder if changing the public interface of your API depending on a setting is the clearest thing to do, from the user perspective. Is there any reason why you're not always returning a |
I agree, but this is from Netlify's GoTrue server. If this was our own server I would have preferred consistency. We could change this in our own fork, but I don't think Netlify would ever merge it upstream. However I can make it so that this client library always returns the |
@kiwicopple Ideally
Also, running the function twice in a row returns this:
|
Let me set up some more test cases for this. It seems there are a few quirks with GoTrue which we need to cover. |
I've added 3 test suites:
I can confirm that @thepandaguitar's case is throwing a I'm also going to add a const { user, session } = supabase.auth.signUp({ email, password })
// with auto confirm on: user and session are both returned
// with auto confirm off: user is returned but session is null |
🎉 This issue has been resolved in version 1.10.6 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Related issue: supabase/auth-js#45
OK all, thanks for the patience:
I will spend some time improving the Auth docs, in particular I think it will be useful to have the return types listed, but that's part of a larger issue which is already open @thepandaguitar - I created a new issue to track the strange error from GoTrue: #55 |
@kiwicopple Thank you for the quick resolution! |
May be just a documentation issue:
The text was updated successfully, but these errors were encountered: