Skip to content

Commit

Permalink
Merge pull request #145 from bitcoinppl/10-require-biometric-or-pin-w…
Browse files Browse the repository at this point in the history
…hen-interacting-with-the-private-key

Require biometric or pin when interacting with the private key
  • Loading branch information
praveenperera authored Dec 15, 2024
2 parents 84dd6c7 + 1318da4 commit db6f418
Show file tree
Hide file tree
Showing 13 changed files with 514 additions and 273 deletions.
14 changes: 14 additions & 0 deletions ios/Cove/AppManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,14 @@ import SwiftUI
var prices: PriceResponse?
var fees: FeeResponse?

var lockState: LockState = .locked

// changed when route is reset, to clear lifecycle view state
var routeId = UUID()

@MainActor
var isUsingBiometrics: Bool = false

@ObservationIgnored
weak var walletManager: WalletManager?

Expand Down Expand Up @@ -74,6 +79,15 @@ import SwiftUI
walletManager = vm
}

public func lock() {
guard isAuthEnabled else { return }
lockState = .locked
}

public func checkPin(_ pin: String) -> Bool {
AuthPin().check(pin: pin)
}

var isAuthEnabled: Bool {
authType != AuthType.none
}
Expand Down
Loading

0 comments on commit db6f418

Please sign in to comment.