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
@@ -13,9 +13,21 @@ enum AppLockScreenViewModelAction {
case appUnlocked
/// The user failed to unlock the app (or forgot their PIN).
case forceLogout
/// The user cancelled device owner verification. Only sent in the `.verifyDeviceOwner` mode.
case cancelVerifyDeviceOwner
}
enum AppLockScreenMode {
/// Unlocking the app on launch/foregrounding.
case appUnlock
/// Verifying that the user is the device owner to gate a sensitive action.
case verifyDeviceOwner
}
struct AppLockScreenViewState: BindableState {
/// The context in which the screen is being shown.
var mode: AppLockScreenMode = .appUnlock
/// The number of attempts allowed to unlock the app.
let maximumAttempts = 3
@@ -64,4 +76,6 @@ enum AppLockScreenViewAction {
case clearPINCode
/// The user didn't heed the warnings and can't remember their PIN.
case forgotPIN
/// The user cancelled device owner verification.
case cancelVerifyDeviceOwner
}