Skip to content

Commit

Permalink
differentiate device having not setup biometrics, compared too user d…
Browse files Browse the repository at this point in the history
…enying it
  • Loading branch information
simonmcl committed Jul 28, 2023
1 parent 33210c3 commit 4848edb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Sources/KukaiCoreSwift/Models/CurrentDevice.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ public enum CurrentDevice {
var error: NSError?

guard authContext.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error) else {
return .unavailable
if error?.code == -7 {
return .unavailable // User has not setup biometrics on their device
} else {
return .none // (code == -6) = User has denied access
}
}

if #available(iOS 11.0, *) {
Expand Down

0 comments on commit 4848edb

Please sign in to comment.