From d1b9685cd53fd7c308846ffae12d7757c32e7103 Mon Sep 17 00:00:00 2001 From: Harshdeep Singh <6162866+harsh62@users.noreply.github.com> Date: Fri, 31 Jan 2025 13:59:17 -0500 Subject: [PATCH] fix warnings --- .../Actions/SignOut/InitiateSignOut.swift | 6 +++--- .../Actions/SignOut/ShowHostedUISignOut.swift | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Actions/SignOut/InitiateSignOut.swift b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Actions/SignOut/InitiateSignOut.swift index da85c34940..8f95607b86 100644 --- a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Actions/SignOut/InitiateSignOut.swift +++ b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Actions/SignOut/InitiateSignOut.swift @@ -40,15 +40,15 @@ struct InitiateSignOut: Action { let data = try await credentialStoreClient?.fetchData( type: .amplifyCredentials ) - guard case .amplifyCredentials(var credentials) = data else { + guard case .amplifyCredentials(let credentials) = data else { return signedInData } // Update SignedInData based on credential type switch credentials { - case .userPoolOnly(var updatedSignedInData): + case .userPoolOnly(let updatedSignedInData): return updatedSignedInData - case .userPoolAndIdentityPool(var updatedSignedInData, _, _): + case .userPoolAndIdentityPool(let updatedSignedInData, _, _): return updatedSignedInData case .identityPoolOnly, .identityPoolWithFederation, .noCredentials: return signedInData diff --git a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Actions/SignOut/ShowHostedUISignOut.swift b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Actions/SignOut/ShowHostedUISignOut.swift index f70dee5233..04ccb81fbe 100644 --- a/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Actions/SignOut/ShowHostedUISignOut.swift +++ b/AmplifyPlugins/Auth/Sources/AWSCognitoAuthPlugin/Actions/SignOut/ShowHostedUISignOut.swift @@ -46,8 +46,7 @@ class ShowHostedUISignOut: NSObject, Action { inPrivate: false, presentationAnchor: signOutEvent.presentationAnchor) await sendEvent(with: nil, dispatcher: dispatcher, environment: environment) - } - catch HostedUIError.cancelled { + } catch HostedUIError.cancelled { if signInData.isRefreshTokenExpired == true { self.logVerbose("\(#fileID) Received user cancelled error, but session is expired and continue signing out.", environment: environment) await sendEvent(with: nil, dispatcher: dispatcher, environment: environment) @@ -55,8 +54,7 @@ class ShowHostedUISignOut: NSObject, Action { self.logVerbose("\(#fileID) Received error \(HostedUIError.cancelled)", environment: environment) await sendEvent(with: HostedUIError.cancelled, dispatcher: dispatcher, environment: environment) } - } - catch { + } catch { self.logVerbose("\(#fileID) Received error \(error)", environment: environment) await sendEvent(with: error, dispatcher: dispatcher, environment: environment) }