-
-
Notifications
You must be signed in to change notification settings - Fork 123
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
feat(auth): add signInWithOAuth
#299
Conversation
ceecd44
to
3c202fa
Compare
aa2e37e
to
9231613
Compare
e49a743
to
d567460
Compare
bdc757a
to
eea5ae4
Compare
eea5ae4
to
2afffb0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to double-check, the following code on the PR body is actually meant to be signInWithOAuth
, correct?
let session = try await signInWithProvider(provider: .google) { session in
// additional configuration to session object
session.presentationContextProvider = YourCustomImplementation()
}
Yes @dshukertjr thanks for that. |
What kind of change does this PR introduce?
Close #257
How OAuth worked before?
Before the OAuth implementation consisted of 3 steps:
getOAuthSignInURL
method that returned aURL
type.token/code
.session(from:)
method that would parse the URL and import the session into the client.How it works after this PR?
Everything from How OAuth worked before? is still valid in case user wants full control of the flow.
But now there are 2 convenience methods (built on top of the already existent methods).
Sign in leveraging the steps mentioned above but injecting the Step 2
Sign in using ASWebAuthenticationSession on the platforms that supports it (Recommended)
Other changes introduced
redirectURL
on all methods, you can pass one when initializing the client, and it will be used as the default if none is provided in the method.