Skip to content

Update PhoneAuthProvider.swift addressing comments #14170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions FirebaseAuth/Sources/Swift/AuthProvider/PhoneAuthProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import Foundation
@objc(FIRPhoneAuthProvider) open class PhoneAuthProvider: NSObject {
/// A string constant identifying the phone identity provider.
@objc public static let id = "phone"
@objc private static let kRecaptchaVersion = "RECAPTCHA_ENTERPRISE"
@objc private static let kClientType = "CLIENT_TYPE_IOS"
@objc private static let kFakeCaptchaResponse = "NO_RECAPTCHA"
private static let recaptchaVersion = "RECAPTCHA_ENTERPRISE"
private static let clientType = "CLIENT_TYPE_IOS"
private static let fakeCaptchaResponse = "NO_RECAPTCHA"

#if os(iOS)
/// Returns an instance of `PhoneAuthProvider` for the default `Auth` object.
Expand Down Expand Up @@ -260,7 +260,7 @@ import Foundation
}

/// Starts the flow to verify the client via silent push notification.
/// - Parameter retryOnInvalidAppCredential: Whether of not the flow should be retried if an
/// - Parameter retryOnInvalidAppCredential: Whether or not the flow should be retried if an
/// AuthErrorCodeInvalidAppCredential error is returned from the backend.
/// - Parameter phoneNumber: The phone number to be verified.
/// - Parameter callback: The callback to be invoked on the global work queue when the flow is
Expand All @@ -277,8 +277,8 @@ import Foundation
.requestConfiguration)
if auditFallback {
request.injectRecaptchaFields(
recaptchaResponse: PhoneAuthProvider.kFakeCaptchaResponse,
recaptchaVersion: PhoneAuthProvider.kRecaptchaVersion
recaptchaResponse: PhoneAuthProvider.fakeCaptchaResponse,
recaptchaVersion: PhoneAuthProvider.recaptchaVersion
)
}
do {
Expand Down Expand Up @@ -402,9 +402,9 @@ import Foundation
codeIdentity: codeIdentity)
if auditFallback {
startMFARequestInfo.injectRecaptchaFields(
recaptchaResponse: PhoneAuthProvider.kFakeCaptchaResponse,
recaptchaVersion: PhoneAuthProvider.kRecaptchaVersion,
clientType: PhoneAuthProvider.kClientType
recaptchaResponse: PhoneAuthProvider.fakeCaptchaResponse,
recaptchaVersion: PhoneAuthProvider.recaptchaVersion,
clientType: PhoneAuthProvider.clientType
)
}
do {
Expand Down
Loading