From 1c9e7372e8c2e0bd5e08862eab8dbba0b5dbcb71 Mon Sep 17 00:00:00 2001 From: Carlos Cabanero Date: Tue, 9 Apr 2024 16:38:19 -0400 Subject: [PATCH] WebAuthn retains the cancel signature - Tracking 1988. In theory the thread is still active so it shouldn't be collected. But the flow was being cancelled. This way we make the retention more explicit. --- BlinkConfig/WebAuthnKey.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BlinkConfig/WebAuthnKey.swift b/BlinkConfig/WebAuthnKey.swift index efb4e9d19..cfbe8948f 100644 --- a/BlinkConfig/WebAuthnKey.swift +++ b/BlinkConfig/WebAuthnKey.swift @@ -50,6 +50,7 @@ public class WebAuthnKey: NSObject { var log: SSHLogger? = nil //var authAnchor: ASPresentationAnchor? = nil var signaturePub: PassthroughSubject! + var cancelSignature: AnyCancellable! public var comment: String? = nil @@ -107,7 +108,7 @@ extension WebAuthnKey: Signer { var error: Error? = nil self.signaturePub = PassthroughSubject() // Controller needs to be displayed on main. - let cancel = Just(authController) + self.cancelSignature = Just(authController) .receive(on: DispatchQueue.main) .flatMap { authController in authController.performRequests() // options: .preferImmediatelyAvailableCredentials may suppress the UI, and it doesn't make sense in our scenario