@@ -276,7 +276,7 @@ export class LockComponent implements OnInit, OnDestroy {
276276 this . lockComponentService . getAvailableUnlockOptions$ ( activeAccount . id ) ,
277277 ) ;
278278
279- this . setDefaultActiveUnlockOption ( this . unlockOptions ) ;
279+ await this . setDefaultActiveUnlockOption ( this . unlockOptions ) ;
280280
281281 if ( this . unlockOptions ?. biometrics . enabled ) {
282282 await this . handleBiometricsUnlockEnabled ( ) ;
@@ -299,14 +299,26 @@ export class LockComponent implements OnInit, OnDestroy {
299299 } ) ;
300300 }
301301
302- private setDefaultActiveUnlockOption ( unlockOptions : UnlockOptions | null ) {
302+ private async setDefaultActiveUnlockOption ( unlockOptions : UnlockOptions | null ) {
303+ const biometricsStatus = await this . biometricService . getBiometricsStatusForUser (
304+ this . activeAccount . id ,
305+ ) ;
306+
303307 // Priorities should be Biometrics > Pin > Master Password for speed
304308 if ( unlockOptions ?. biometrics . enabled ) {
305309 this . activeUnlockOption = UnlockOption . Biometrics ;
306310 } else if ( unlockOptions ?. pin . enabled ) {
307311 this . activeUnlockOption = UnlockOption . Pin ;
308312 } else if ( unlockOptions ?. masterPassword . enabled ) {
309313 this . activeUnlockOption = UnlockOption . MasterPassword ;
314+ // If biometrics is temporarily unavailable for masterpassword-less users, but they have biometrics configured,
315+ // then show the biometrics screen so the user knows why they can't unlock, and to give them the option to log out.
316+ } else if (
317+ biometricsStatus === BiometricsStatus . HardwareUnavailable ||
318+ biometricsStatus === BiometricsStatus . DesktopDisconnected ||
319+ biometricsStatus === BiometricsStatus . NotEnabledInConnectedDesktopApp
320+ ) {
321+ this . activeUnlockOption = UnlockOption . Biometrics ;
310322 }
311323 }
312324
0 commit comments