diff --git a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Actions/SignOut/ShowHostedUISignOut.swift b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Actions/SignOut/ShowHostedUISignOut.swift index 10db773e4b..9cdf64017b 100644 --- a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Actions/SignOut/ShowHostedUISignOut.swift +++ b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Actions/SignOut/ShowHostedUISignOut.swift @@ -40,19 +40,11 @@ class ShowHostedUISignOut: NSObject, Action { do { let logoutURL = try HostedUIRequestHelper.createSignOutURL(configuration: hostedUIConfig) let sessionAdapter = hostedUIEnvironment.hostedUISessionFactory() - #if os(iOS) || os(macOS) || os(visionOS) _ = try await sessionAdapter.showHostedUI( url: logoutURL, callbackScheme: callbackURLScheme, inPrivate: false, presentationAnchor: signOutEvent.presentationAnchor) - #else - _ = try await sessionAdapter.showHostedUI( - url: logoutURL, - callbackScheme: callbackURLScheme, - inPrivate: false, - presentationAnchor: nil) - #endif await sendEvent(with: nil, dispatcher: dispatcher, environment: environment) } catch { self.logVerbose("\(#fileID) Received error \(error)", environment: environment) diff --git a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/StateMachine/CodeGen/Data/SignOutEventData.swift b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/StateMachine/CodeGen/Data/SignOutEventData.swift index 7b8bdd1666..1dbdbfcac2 100644 --- a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/StateMachine/CodeGen/Data/SignOutEventData.swift +++ b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/StateMachine/CodeGen/Data/SignOutEventData.swift @@ -11,18 +11,12 @@ struct SignOutEventData { let globalSignOut: Bool - #if os(iOS) || os(macOS) || os(visionOS) let presentationAnchor: AuthUIPresentationAnchor? init(globalSignOut: Bool, presentationAnchor: AuthUIPresentationAnchor? = nil) { self.globalSignOut = globalSignOut self.presentationAnchor = presentationAnchor } - #else - init(globalSignOut: Bool) { - self.globalSignOut = globalSignOut - } - #endif } extension SignOutEventData: Equatable { } @@ -50,9 +44,8 @@ extension SignOutEventData: Codable { init(from decoder: Decoder) throws { let values = try decoder.container(keyedBy: CodingKeys.self) globalSignOut = try values.decode(Bool.self, forKey: .globalSignOut) - #if os(iOS) || os(macOS) || os(visionOS) presentationAnchor = nil - #endif + } func encode(to encoder: Encoder) throws {