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

Update OAuth2Authorizer+iOS.swift #402

Merged
merged 1 commit into from Feb 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 1 addition & 6 deletions Sources/iOS/OAuth2Authorizer+iOS.swift
Expand Up @@ -167,20 +167,15 @@ open class OAuth2Authorizer: OAuth2AuthorizerUI {
self.webAuthenticationPresentationContextProvider = nil
}

#if targetEnvironment(macCatalyst)
authenticationSession = ASWebAuthenticationSession(url: url, callbackURLScheme: redirectURL.scheme, completionHandler: completionHandler)
return (authenticationSession as! ASWebAuthenticationSession).start()
#else
authenticationSession = ASWebAuthenticationSession(url: url, callbackURLScheme: redirectURL.scheme, completionHandler: completionHandler)
if #available(iOS 13.0, *) {
if #available(iOS 13.0, macCatalyst 13.1, *) {
webAuthenticationPresentationContextProvider = OAuth2ASWebAuthenticationPresentationContextProvider(authorizer: self)
if let session = authenticationSession as? ASWebAuthenticationSession {
session.presentationContextProvider = webAuthenticationPresentationContextProvider as! OAuth2ASWebAuthenticationPresentationContextProvider
session.prefersEphemeralWebBrowserSession = prefersEphemeralWebBrowserSession
}
}
return (authenticationSession as! ASWebAuthenticationSession).start()
#endif
}


Expand Down