mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-21 17:12:45 +02:00
MESSENGER-3675 Security fix faceID, master tag for sdk
This commit is contained in:
@@ -115,9 +115,19 @@ final class PinCodePreferences: NSObject {
|
||||
|
||||
var isBiometricsAvailable: Bool {
|
||||
let context = LAContext()
|
||||
if context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: nil) {
|
||||
return context.biometryType == .touchID || context.biometryType == .faceID
|
||||
var error: NSError?
|
||||
|
||||
let result = LAContext().canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error)
|
||||
|
||||
// While in lockout they're still techincally available
|
||||
if error?.code == LAError.Code.biometryLockout.rawValue {
|
||||
return true
|
||||
}
|
||||
|
||||
if result == true {
|
||||
return context.biometryType == .touchID || context.biometryType == .faceID
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user