From fe18d9af8e7b93583af6235665e08ed80410320c Mon Sep 17 00:00:00 2001 From: mathieu J Date: Mon, 4 Dec 2023 16:42:28 +0200 Subject: [PATCH] :sparkles: (AccountKit): Add ResetPassword case to Auth Operations --- .../Sources/ViewModels/AuthManager.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Modules/AccountKit/Examples/AccountKitExample/Sources/ViewModels/AuthManager.swift b/Modules/AccountKit/Examples/AccountKitExample/Sources/ViewModels/AuthManager.swift index 403f87f54a..b41af2da2a 100644 --- a/Modules/AccountKit/Examples/AccountKitExample/Sources/ViewModels/AuthManager.swift +++ b/Modules/AccountKit/Examples/AccountKitExample/Sources/ViewModels/AuthManager.swift @@ -13,9 +13,9 @@ class AuthManager: ObservableObject { } enum FirebaseAuthenticationOperation: String { - case none = "" case signIn = "signed in" case signUp = "signed up" + case resetPassword = "" } @Published private(set) var companyAuthenticationState: FirebaseAuthenticationState = .unknown @@ -66,7 +66,7 @@ class AuthManager: ObservableObject { func sendPasswordReset(with email: String) { auth.sendPasswordReset(withEmail: email) .sink { [weak self] completion in - self?.handleCompletion(completion, newState: .unknown, operation: .none) + self?.handleCompletion(completion, newState: .unknown, operation: .resetPassword) } receiveValue: { _ in // nothing to do } @@ -110,12 +110,12 @@ class AuthManager: ObservableObject { case .failure(let error): errorMessage = error.localizedDescription switch operation { - case .none: - print(errorMessage) case .signIn: handleSignInError(error) case .signUp: handleSignUpError(error) + case .resetPassword: + print(errorMessage) } companyAuthenticationState = newState }