Skip to content

Commit e17ee4d

Browse files
fix: do not show error modal when MFA required
1 parent ad1f667 commit e17ee4d

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
@@ -235,8 +235,6 @@ public final class AuthService {
235235
}
236236
} catch let error as NSError {
237237
authenticationState = .unauthenticated
238-
updateError(message: string.localizedErrorMessage(for: error))
239-
240238
// Check if this is an MFA required error
241239
if error.code == AuthErrorCode.secondFactorRequired.rawValue {
242240
if let resolver = error
@@ -245,6 +243,9 @@ public final class AuthService {
245243
pendingMFACredential = credentials
246244
return handleMFARequiredError(resolver: resolver)
247245
}
246+
} else {
247+
// Don't want error modal on MFA error so we only update here
248+
updateError(message: string.localizedErrorMessage(for: error))
248249
}
249250

250251
throw error

0 commit comments

Comments
 (0)