From 3df4bcef3cbc3eb77e2051b01bd1a9299d54f432 Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Sat, 20 Jan 2024 19:08:20 -0800 Subject: [PATCH] . --- .../Sources/SecureEnclaveSecretKit/SecureEnclaveStore.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sources/Packages/Sources/SecureEnclaveSecretKit/SecureEnclaveStore.swift b/Sources/Packages/Sources/SecureEnclaveSecretKit/SecureEnclaveStore.swift index f17df64..194eab7 100644 --- a/Sources/Packages/Sources/SecureEnclaveSecretKit/SecureEnclaveStore.swift +++ b/Sources/Packages/Sources/SecureEnclaveSecretKit/SecureEnclaveStore.swift @@ -199,12 +199,15 @@ extension SecureEnclave { // Contexts will expire within LATouchIDAuthenticationMaximumAllowableReuseDuration unless we periodically refresh them if duration > LATouchIDAuthenticationMaximumAllowableReuseDuration { Timer.scheduledTimer(withTimeInterval: LATouchIDAuthenticationMaximumAllowableReuseDuration - 10, repeats: true) { [weak self] timer in + print("Refreshing context") guard let refreshContext = self?.persistedAuthenticationContexts[secret] else { return } guard refreshContext.valid else { timer.invalidate() return } refreshContext.context.evaluatePolicy(.deviceOwnerAuthentication, localizedReason: "Refresh") { success, _ in + guard success else { return } + print("Refreshed") } } }