Closed ky1ejs closed 2 years ago
Hi @ky1ejs thanks for opening this, I'll take a look on this and fix it ASAP.
I'm happy to open a PR for this issue, I was more so looking to understand if this is the correct behaviour for mobile clients / the REST API. I was hoping @inian or someone from Supabase would speak to that.
@ky1ejs I've opened a PR fixing this, can you take a look at it and maybe point your app to the fixed branch and verify if the issue has been solved?
PR: https://github.com/supabase-community/gotrue-swift/pull/23
I'm happy to open a PR for this issue, I was more so looking to understand if this is the correct behaviour for mobile clients / the REST API. I was hoping @inian or someone from Supabase would speak to that.
The behavior should be the same for all platforms, this was a mistake when building.
Agree that the callback params should be in the query fragment!
@grsouza I'll take a look and confirm with you asap in this issue
@grsouza confirmed that this fix works 🎉
It would be great if a version bump could be processed soon for grotrue-swift
and supabase-swift
.
Although, I'd love to provide some tweaks to the API for gotrue, such as adding @discarableResult
for functions such as:
let _ = try! await client.auth.session(from: callbackUrl.absoluteURL)
I'm a bit confused about how this lib is supposed to be used for signing in via a Provider (e.g. Google Oauth).
As mentioned by this issue in the
supabase/supabase
repo (see screenshot below) callbacks come with params as a fragment, not a query.However this lib asserts that a query is required to parse a Provider based sign-in: https://github.com/supabase-community/gotrue-swift/blob/5a5aca5aa63fbb4639458dc0c044f17586c3c9d7/Tests/GoTrueTests/GoTrueTests.swift#L45-L68
So the following code fails:
This is the exact
callbackUrl
that this code receives:supabase/supabase
discussions/2133