Skip to content

Commit e93e0ca

Browse files
grdsdevclaude
andcommitted
refactor(auth): simplify biometric error types
Remove redundant error cases from BiometricError and BiometricUnavailableReason: - Remove notEnabled from BiometricError (handled differently) - Remove biometryNotEnrolled, biometryLockout, other from BiometricUnavailableReason (these are covered by notAvailable or other error paths) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 96c9e52 commit e93e0ca

1 file changed

Lines changed: 0 additions & 20 deletions

File tree

Sources/Auth/Biometrics/BiometricTypes.swift

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@
7979
/// Biometric authentication was locked out due to too many failed attempts.
8080
case lockedOut
8181

82-
/// Biometrics are not enabled for this client.
83-
case notEnabled
84-
8582
public var errorDescription: String? {
8683
switch self {
8784
case .notAvailable(let reason):
@@ -94,8 +91,6 @@
9491
return "No biometrics enrolled on this device."
9592
case .lockedOut:
9693
return "Biometrics locked out due to too many failed attempts."
97-
case .notEnabled:
98-
return "Biometrics are not enabled for this client."
9994
}
10095
}
10196
}
@@ -105,30 +100,15 @@
105100
/// No biometric hardware available on this device.
106101
case noBiometryAvailable
107102

108-
/// Biometrics are not enrolled (no Face ID / Touch ID set up).
109-
case biometryNotEnrolled
110-
111-
/// Biometrics are temporarily locked out due to too many failed attempts.
112-
case biometryLockout
113-
114103
/// Device passcode is not set.
115104
case passcodeNotSet
116105

117-
/// Other error with a specific code.
118-
case other(code: Int)
119-
120106
var localizedDescription: String {
121107
switch self {
122108
case .noBiometryAvailable:
123109
return "No biometric hardware available."
124-
case .biometryNotEnrolled:
125-
return "No biometrics enrolled."
126-
case .biometryLockout:
127-
return "Biometrics temporarily unavailable due to lockout."
128110
case .passcodeNotSet:
129111
return "Device passcode is not set."
130-
case .other(let code):
131-
return "Unknown error (code: \(code))."
132112
}
133113
}
134114
}

0 commit comments

Comments
 (0)