From 9638d6ca49e9995689bfaf9c1cb13cb2ae96edb9 Mon Sep 17 00:00:00 2001 From: Thomas Rademaker Date: Sat, 27 Jun 2026 21:30:31 -0400 Subject: [PATCH 1/2] Fix native macOS build by excluding SwiftUI WebAuthenticationSession --- Sources/OAuthenticator/WebAuthenticationSession+Utility.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/OAuthenticator/WebAuthenticationSession+Utility.swift b/Sources/OAuthenticator/WebAuthenticationSession+Utility.swift index fb4f6ae..3cb1ed0 100644 --- a/Sources/OAuthenticator/WebAuthenticationSession+Utility.swift +++ b/Sources/OAuthenticator/WebAuthenticationSession+Utility.swift @@ -1,9 +1,9 @@ -#if canImport(AuthenticationServices) +#if canImport(AuthenticationServices) && !os(macOS) import AuthenticationServices import SwiftUI -@available(macOS 13.3, iOS 16.4, watchOS 9.4, tvOS 16.4, *) +@available(iOS 16.4, macCatalyst 16.4, watchOS 9.4, tvOS 16.4, *) extension WebAuthenticationSession { public func userAuthenticator(preferredBrowserSession: BrowserSession? = nil) -> Authenticator.UserAuthenticator { return { From bdb4b198f8df962daafbfe39421a9a4e49f5fc8d Mon Sep 17 00:00:00 2001 From: Matt <85322+mattmassicotte@users.noreply.github.com> Date: Tue, 7 Jul 2026 09:29:36 -0400 Subject: [PATCH 2/2] use the _AuthenticationServices_SwiftUI import workaround --- .../OAuthenticator/WebAuthenticationSession+Utility.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Sources/OAuthenticator/WebAuthenticationSession+Utility.swift b/Sources/OAuthenticator/WebAuthenticationSession+Utility.swift index 3cb1ed0..a23ad5b 100644 --- a/Sources/OAuthenticator/WebAuthenticationSession+Utility.swift +++ b/Sources/OAuthenticator/WebAuthenticationSession+Utility.swift @@ -1,9 +1,11 @@ -#if canImport(AuthenticationServices) && !os(macOS) -import AuthenticationServices +// It is not 100% clear why a plain import of "AuthenticationServices" does not work here, +// but in some cases/configuration it appears to fail. +#if canImport(_AuthenticationServices_SwiftUI) +import _AuthenticationServices_SwiftUI import SwiftUI -@available(iOS 16.4, macCatalyst 16.4, watchOS 9.4, tvOS 16.4, *) +@available(macOS 13.3, iOS 16.4, macCatalyst 16.4, watchOS 9.4, tvOS 16.4, *) extension WebAuthenticationSession { public func userAuthenticator(preferredBrowserSession: BrowserSession? = nil) -> Authenticator.UserAuthenticator { return {