Skip to content

Commit

Permalink
✨ (AccountKit): Add ResetPassword case to Auth Operations
Browse files Browse the repository at this point in the history
  • Loading branch information
macteuts committed Dec 4, 2023
1 parent 2c28cc9 commit fe18d9a
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit fe18d9a

Please sign in to comment.