Skip to content

Commit 4f29af1

Browse files
committed
cleanup to simplify diff
1 parent 5e74e23 commit 4f29af1

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

FirebaseAuth/Sources/Swift/Utilities/AuthRecaptchaVerifier.swift

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,30 @@ class AuthRecaptchaVerifier {
7676
#if os(iOS)
7777
private var recaptchaClient: RCARecaptchaClientProtocol?
7878

79+
private func siteKey() -> String? {
80+
if let tenantID = auth?.tenantID {
81+
if let config = tenantConfigs[tenantID] {
82+
return config.siteKey
83+
}
84+
return nil
85+
}
86+
return agentConfig?.siteKey
87+
}
88+
89+
func enablementStatus(forProvider provider: AuthRecaptchaProvider)
90+
-> AuthRecaptchaEnablementStatus {
91+
if let tenantID = auth?.tenantID,
92+
let tenantConfig = tenantConfigs[tenantID],
93+
let status = tenantConfig.enablementStatus[provider] {
94+
return status
95+
} else if let agentConfig = agentConfig,
96+
let status = agentConfig.enablementStatus[provider] {
97+
return status
98+
} else {
99+
return AuthRecaptchaEnablementStatus.off
100+
}
101+
}
102+
79103
func verify(forceRefresh: Bool, action: AuthRecaptchaAction) async throws -> String {
80104
try await retrieveRecaptchaConfig(forceRefresh: forceRefresh)
81105
guard let siteKey = siteKey() else {
@@ -114,30 +138,6 @@ class AuthRecaptchaVerifier {
114138
#endif // !(COCOAPODS || SWIFT_PACKAGE)
115139
}
116140

117-
private func siteKey() -> String? {
118-
if let tenantID = auth?.tenantID {
119-
if let config = tenantConfigs[tenantID] {
120-
return config.siteKey
121-
}
122-
return nil
123-
}
124-
return agentConfig?.siteKey
125-
}
126-
127-
func enablementStatus(forProvider provider: AuthRecaptchaProvider)
128-
-> AuthRecaptchaEnablementStatus {
129-
if let tenantID = auth?.tenantID,
130-
let tenantConfig = tenantConfigs[tenantID],
131-
let status = tenantConfig.enablementStatus[provider] {
132-
return status
133-
} else if let agentConfig = agentConfig,
134-
let status = agentConfig.enablementStatus[provider] {
135-
return status
136-
} else {
137-
return AuthRecaptchaEnablementStatus.off
138-
}
139-
}
140-
141141
private func recaptchaToken(siteKey: String,
142142
actionString: String,
143143
fakeToken: String) async -> (token: String, error: Error?,

0 commit comments

Comments
 (0)