Skip to content

Commit ed5ea20

Browse files
authored
Update RCE flow to skip checking status if appVerificationDisabledForTesting is set (#14310)
1 parent c092c02 commit ed5ea20

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

FirebaseAuth/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
for decoding `nil` values. (#14212)
55
- [fixed] Address Xcode 16.2 concurrency compile time issues. (#14279)
66
- [fixed] Fix handling of cloud blocking function errors. (#14052)
7+
- [fixed] Fix phone auth flow to skip RCE verification if appVerificationDisabledForTesting is set. (#14242)
78

89
# 11.6.0
910
- [added] Added reCAPTCHA Enterprise support for app verification during phone

FirebaseAuth/Sources/Swift/AuthProvider/PhoneAuthProvider.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,21 @@ import Foundation
203203
}
204204

205205
let recaptchaVerifier = AuthRecaptchaVerifier.shared(auth: auth)
206+
207+
if let settings = auth.settings,
208+
settings.isAppVerificationDisabledForTesting {
209+
// If app verification is disabled for testing
210+
// do not fetch recaptcha config, as this is not implemented in emulator
211+
// Treat this same as RCE enable status off
212+
213+
return try await verifyClAndSendVerificationCode(
214+
toPhoneNumber: phoneNumber,
215+
retryOnInvalidAppCredential: true,
216+
multiFactorSession: multiFactorSession,
217+
uiDelegate: uiDelegate
218+
)
219+
}
220+
206221
try await recaptchaVerifier.retrieveRecaptchaConfig(forceRefresh: true)
207222

208223
switch recaptchaVerifier.enablementStatus(forProvider: .phone) {

0 commit comments

Comments
 (0)