Skip to content

Commit

Permalink
Update RCE flow to skip checking status if appVerificationDisabledFor…
Browse files Browse the repository at this point in the history
…Testing is set (#14310)
  • Loading branch information
pashanka authored Jan 7, 2025
1 parent c092c02 commit ed5ea20
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions FirebaseAuth/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
for decoding `nil` values. (#14212)
- [fixed] Address Xcode 16.2 concurrency compile time issues. (#14279)
- [fixed] Fix handling of cloud blocking function errors. (#14052)
- [fixed] Fix phone auth flow to skip RCE verification if appVerificationDisabledForTesting is set. (#14242)

# 11.6.0
- [added] Added reCAPTCHA Enterprise support for app verification during phone
Expand Down
15 changes: 15 additions & 0 deletions FirebaseAuth/Sources/Swift/AuthProvider/PhoneAuthProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,21 @@ import Foundation
}

let recaptchaVerifier = AuthRecaptchaVerifier.shared(auth: auth)

if let settings = auth.settings,
settings.isAppVerificationDisabledForTesting {
// If app verification is disabled for testing
// do not fetch recaptcha config, as this is not implemented in emulator
// Treat this same as RCE enable status off

return try await verifyClAndSendVerificationCode(
toPhoneNumber: phoneNumber,
retryOnInvalidAppCredential: true,
multiFactorSession: multiFactorSession,
uiDelegate: uiDelegate
)
}

try await recaptchaVerifier.retrieveRecaptchaConfig(forceRefresh: true)

switch recaptchaVerifier.enablementStatus(forProvider: .phone) {
Expand Down

0 comments on commit ed5ea20

Please sign in to comment.