-
-
Notifications
You must be signed in to change notification settings - Fork 167
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
output of oAuth signin in v2 #417
Comments
I'm trying to migrate to v2 and I also can't figure out how to get the authenticated user when using |
Hi, also curious about this -- are there any examples on how to get a Are we supposed to just call |
If I'm not mistaken This is because the way OAuth sign-in works is the current window location will be set to the authorization URL for the OAuth provider. If calling from a non-browser environment such as React Native, Flutter or other such environments, since there's no I've added an option that will let you access the data object in #575. |
Unfortunately the OAuth flow is very asynchronous and I'm not super keen on adding hacks such as: new Promise((accept, reject) => {
supabase.auth.onAuthStateChange((event, session) => {
if (event === 'SIGNED_IN') { accept(session) }
})
}) You kinda have to do this via the |
@hf I don't think anyone is asking for the code to change. When you closed this ticket your comment implied the pull request included the documentation requested in this case. But, when I looked at the pull request it adds a new flag and I didn't see the connection between the flag and the documentation requested by this issue. In v1 it was clear how you got the user/session. I just re-checked and the current documentation/auth video doesn't have any links or examples (that I could find) about what new devs need to do once they call I'm sure it is obvious to you what needs to be done. But, I'd love to see a full worked out example. So I think this request for documentation is still valid. |
Yes you're right. Reopening. |
Allows for custom handling of the redirect URL when in browser environments. Fixes: #417
🎉 This issue has been resolved in version 2.9.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Can someone please just explain to me how to get the user and session data from the signInWithOAuth method so I can move on with my life? |
Improve documentation
Link
https://supabase.com/docs/reference/javascript/next/auth-signinwithoauth#examples
Describe the problem
oAuth signin example in the link above suggest that
signInWithOAuth
returns regulardata
object that containssession
.For ref: it documents following line in the code snippet.In
v1
it used to returnUser
andSession
object.However while trying to migrate I discovered that OAuthResponse return provider name and
url
returned by the provider. I am not sure if this is intentional or is it work in progress? Because, it seems inconsistent with other auth methods andv1
and it is also different from what thev2
documentation is suggesting.###Is the documentation missing? Or is it confusing? Why is it confusing?
It is confusing
Describe the improvement
Ideally, I would prefer if the
signInWithOAuth
returnsdata
object of type AuthResponse to keep it consistent. If not then the example should describe how one can deriveSession
andUser
object fromOAuthResponse
object.The text was updated successfully, but these errors were encountered: