diff --git a/Sources/OAuthenticator/ASWebAuthenticationSession+Utility.swift b/Sources/OAuthenticator/ASWebAuthenticationSession+Utility.swift index c2595be..3418dc1 100644 --- a/Sources/OAuthenticator/ASWebAuthenticationSession+Utility.swift +++ b/Sources/OAuthenticator/ASWebAuthenticationSession+Utility.swift @@ -5,7 +5,7 @@ enum WebAuthenticationSessionError: Error { case resultInvalid } -@available(tvOS 16.0, *) +@available(tvOS 16.0, macCatalyst 13.0, *) extension ASWebAuthenticationSession { convenience init(url: URL, callbackURLScheme: String, completionHandler: @escaping (Result) -> Void) { self.init(url: url, callbackURLScheme: callbackURLScheme, completionHandler: { (resultURL, error) in @@ -22,7 +22,7 @@ extension ASWebAuthenticationSession { } -@available(tvOS 16.0, *) +@available(tvOS 16.0, macCatalyst 13.0, *) extension ASWebAuthenticationSession { #if os(iOS) || os(macOS) @MainActor @@ -32,7 +32,10 @@ extension ASWebAuthenticationSession { continuation.resume(with: result) }) - session.prefersEphemeralWebBrowserSession = true + if #available(macCatalyst 13.1, *) { + session.prefersEphemeralWebBrowserSession = true + } + session.presentationContextProvider = contextProvider session.start() @@ -51,7 +54,9 @@ extension ASWebAuthenticationSession { continuation.resume(with: result) }) +#if os(watchOS) session.prefersEphemeralWebBrowserSession = true +#endif session.start() } diff --git a/Sources/OAuthenticator/Authenticator.swift b/Sources/OAuthenticator/Authenticator.swift index b77004d..a591f29 100644 --- a/Sources/OAuthenticator/Authenticator.swift +++ b/Sources/OAuthenticator/Authenticator.swift @@ -36,7 +36,7 @@ public final class Authenticator { public let userAuthenticator: UserAuthenticator public let mode: UserAuthenticationMode - @available(tvOS 16.0, *) + @available(tvOS 16.0, macCatalyst 13.0, *) public init(appCredentials: AppCredentials, loginStorage: LoginStorage? = nil, tokenHandling: TokenHandling,