Skip to content

Commit

Permalink
WebAuthn retains the cancel signature
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
Carlos Cabanero committed Apr 9, 2024
1 parent 6cae73e commit 1c9e737
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion BlinkConfig/WebAuthnKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class WebAuthnKey: NSObject {
var log: SSHLogger? = nil
//var authAnchor: ASPresentationAnchor? = nil
var signaturePub: PassthroughSubject<Data, Error>!
var cancelSignature: AnyCancellable!

public var comment: String? = nil

Expand Down Expand Up @@ -107,7 +108,7 @@ extension WebAuthnKey: Signer {
var error: Error? = nil
self.signaturePub = PassthroughSubject<Data, Error>()
// 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
Expand Down

0 comments on commit 1c9e737

Please sign in to comment.