From 92999d13995b35d5c80ee4ac03ffc31d21a24a8e Mon Sep 17 00:00:00 2001 From: Harshdeep Singh <6162866+harsh62@users.noreply.github.com> Date: Mon, 21 Oct 2024 10:58:40 -0400 Subject: [PATCH] fixed unit tests --- .../Actions/SignOut/ShowHostedUISignOut.swift | 6 ++++++ .../StateMachine/CodeGen/Data/SignOutEventData.swift | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Actions/SignOut/ShowHostedUISignOut.swift b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Actions/SignOut/ShowHostedUISignOut.swift index 9efbea9b5d..10db773e4b 100644 --- a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Actions/SignOut/ShowHostedUISignOut.swift +++ b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Actions/SignOut/ShowHostedUISignOut.swift @@ -46,6 +46,12 @@ class ShowHostedUISignOut: NSObject, Action { 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 { diff --git a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/StateMachine/CodeGen/Data/SignOutEventData.swift b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/StateMachine/CodeGen/Data/SignOutEventData.swift index 99d49f3be9..7b8bdd1666 100644 --- a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/StateMachine/CodeGen/Data/SignOutEventData.swift +++ b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/StateMachine/CodeGen/Data/SignOutEventData.swift @@ -18,6 +18,10 @@ struct SignOutEventData { self.globalSignOut = globalSignOut self.presentationAnchor = presentationAnchor } + #else + init(globalSignOut: Bool) { + self.globalSignOut = globalSignOut + } #endif }