Skip to content
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
refactor(auth): use hasPrefix for error reason check
Address review feedback: String.hasPrefix(_:) is the idiomatic way to check a string prefix, rather than the generic Sequence.starts(with:).
  • Loading branch information
paulb777 committed Oct 1, 2026
commit 880eb0f7e01d2cc8a8b7cdde0097c5bcddafed0d
2 changes: 1 addition & 1 deletion FirebaseAuth/Sources/Swift/Backend/AuthBackend.swift
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ final class AuthBackend: AuthBackendProtocol {
if let underlyingErrors = errorDictionary["errors"] as? [Any] {
for case let underlyingError as [String: Any] in underlyingErrors {
if let reason = underlyingError["reason"] as? String {
if reason.starts(with: "keyInvalid") {
if reason.hasPrefix("keyInvalid") {
return AuthErrorUtils.invalidAPIKeyError()
}
if reason == "ipRefererBlocked" {
Expand Down
Loading