Make LinkNewDeviceScreen fall back to the App Lock PIN code when there's no passcode. (#5794)

* Fall back to the AppLock PIN code when there's no passcode.

* Add extra tests on the LinkNewDeviceFlowCoordinator.

* Misc tweaks for clarification.

* Regenerate snapshots.
This commit is contained in:
Doug
2026-07-01 10:13:18 +01:00
committed by GitHub
parent 7097ceb910
commit 123661537a
38 changed files with 296 additions and 21 deletions
@@ -88,19 +88,23 @@ protocol AppLockServiceProtocol: AnyObject {
/// Attempt to unlock the app using FaceID or TouchID.
func unlockWithBiometrics() async -> AppLockServiceBiometricResult
/// The number of attempts the user had made to unlock with a PIN code.
///
/// Note: We don't track the biometric attempts as LAContext does that automatically.
var numberOfPINAttempts: AnyPublisher<Int, Never> { get }
// MARK: Device Owner Verification
/// Verifies the device owner via the device passcode/biometrics, e.g. to gate a sensitive action.
///
/// This is a standalone identity check: it does **not** unlock the app or touch any App Lock
/// state (the grace-period timer or PIN attempt count).
/// - Parameter reason: The localised reason shown in the system prompt.
func verifyDeviceOwner(reason: String) async -> AppLockDeviceOwnerResult
/// The number of attempts the user had made to unlock with a PIN code.
///
/// Note: We don't track the biometric attempts as LAContext does that automatically.
var numberOfPINAttempts: AnyPublisher<Int, Never> { get }
}
// MARK: - Mocks
// sourcery: AutoMockable
extension AppLockServiceProtocol { }