Skip to content

Commit 782eca1

Browse files
Merge pull request #1289 from firebase/stop-error-modal-on-mfa-resolution
2 parents 4803efa + 4a517a2 commit 782eca1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Services/AuthService.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,6 @@ public final class AuthService {
232232
}
233233
} catch let error as NSError {
234234
authenticationState = .unauthenticated
235-
updateError(message: string.localizedErrorMessage(for: error))
236-
237235
// Check if this is an MFA required error
238236
if error.code == AuthErrorCode.secondFactorRequired.rawValue {
239237
if let resolver = error
@@ -242,6 +240,9 @@ public final class AuthService {
242240
pendingMFACredential = credentials
243241
return handleMFARequiredError(resolver: resolver)
244242
}
243+
} else {
244+
// Don't want error modal on MFA error so we only update here
245+
updateError(message: string.localizedErrorMessage(for: error))
245246
}
246247

247248
throw error

0 commit comments

Comments
 (0)