Skip to content

Commit

Permalink
add/remove rebasing changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pragatimodi committed Sep 4, 2024
1 parent c466fc7 commit b5d1882
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
4 changes: 0 additions & 4 deletions FirebaseAuth/Sources/Swift/Utilities/AuthErrorUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,6 @@ class AuthErrorUtils: NSObject {
error(code: .invalidRecaptchaToken, message: message)
}

static func invalidRecaptchaTokenError(message: String?) -> Error {
error(code: .invalidRecaptchaToken, message: message)
}

static func unauthorizedDomainError(message: String?) -> Error {
error(code: .unauthorizedDomain, message: message)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
private(set) var agentConfig: AuthRecaptchaConfig?
private(set) var tenantConfigs: [String: AuthRecaptchaConfig] = [:]
private(set) var recaptchaClient: RCARecaptchaClientProtocol?
private static var _shared: AuthRecaptchaVerifier = .init()
private static var _shared = AuthRecaptchaVerifier()
private let kRecaptchaVersion = "RECAPTCHA_ENTERPRISE"
init() {}

Expand Down
12 changes: 5 additions & 7 deletions FirebaseAuth/Tests/Unit/PhoneAuthProviderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,12 @@
let provider = PhoneAuthProvider.provider(auth: auth)
let mockVerifier = FakeAuthRecaptchaVerifier(captchaResponse: kCaptchaResponse)
AuthRecaptchaVerifier.setShared(mockVerifier, auth: auth)
let requestExpectation = expectation(description: "verifyRequester")
rpcIssuer.rceMode = .enforce
rpcIssuer.rceMode = "ENFORCE"
rpcIssuer?.verifyRequester = { request in
XCTAssertEqual(request.phoneNumber, self.kTestPhoneNumber)
XCTAssertEqual(request.captchaResponse, self.kCaptchaResponse)
XCTAssertEqual(request.recaptchaVersion, "RECAPTCHA_ENTERPRISE")
XCTAssertEqual(request.codeIdentity, CodeIdentity.empty)
requestExpectation.fulfill()
do {
try self.rpcIssuer?
.respond(withJSON: [self.kVerificationIDKey: self.kTestVerificationID])
Expand Down Expand Up @@ -150,9 +148,9 @@
.invalidRecaptchaTokenError(message: "INVALID_RECAPTCHA_TOKEN")
let mockVerifier = FakeAuthRecaptchaVerifier(error: invalidRecaptchaTokenError)
AuthRecaptchaVerifier.setShared(mockVerifier, auth: auth)
rpcIssuer.rceMode = .enforce
rpcIssuer.rceMode = "ENFORCE"
do {
let result = try await provider.verifyClAndSendVerificationCodeWithRecaptcha(
let _ = try await provider.verifyClAndSendVerificationCodeWithRecaptcha(
toPhoneNumber: kTestPhoneNumber,
retryOnInvalidAppCredential: false,
uiDelegate: nil,
Expand All @@ -176,9 +174,9 @@
.missingRecaptchaTokenError(message: "MISSING_RECAPTCHA_TOKEN")
let mockVerifier = FakeAuthRecaptchaVerifier(error: missingRecaptchaTokenError)
AuthRecaptchaVerifier.setShared(mockVerifier, auth: auth)
rpcIssuer.rceMode = .enforce
rpcIssuer.rceMode = "ENFORCE"
do {
let result = try await provider.verifyClAndSendVerificationCodeWithRecaptcha(
let _ = try await provider.verifyClAndSendVerificationCodeWithRecaptcha(
toPhoneNumber: kTestPhoneNumber,
retryOnInvalidAppCredential: false,
uiDelegate: nil,
Expand Down

0 comments on commit b5d1882

Please sign in to comment.