mirror of
https://github.com/lil-org/tokenary.git
synced 2024-12-02 09:33:49 +03:00
Ask for owner authentication only when applicable
This commit is contained in:
parent
f02cb7fb8b
commit
381f0176fd
@ -86,6 +86,13 @@ class Agent {
|
|||||||
|
|
||||||
private func proceedAfterAuthentication(reason: String, completion: @escaping (Bool) -> Void) {
|
private func proceedAfterAuthentication(reason: String, completion: @escaping (Bool) -> Void) {
|
||||||
let context = LAContext()
|
let context = LAContext()
|
||||||
|
|
||||||
|
var error: NSError?
|
||||||
|
guard context.canEvaluatePolicy(.deviceOwnerAuthentication, error: &error) else {
|
||||||
|
completion(true)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
context.localizedCancelTitle = "Cancel"
|
context.localizedCancelTitle = "Cancel"
|
||||||
context.evaluatePolicy(.deviceOwnerAuthentication, localizedReason: reason ) { success, _ in
|
context.evaluatePolicy(.deviceOwnerAuthentication, localizedReason: reason ) { success, _ in
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
|
Loading…
Reference in New Issue
Block a user