mirror of
https://github.com/bitwarden/android.git
synced 2024-12-25 18:38:27 +03:00
PM-5064 Fix lock interaction between biometrics and vault timeout never (#2885)
This commit is contained in:
parent
afbcb212f6
commit
5b249bed67
1 changed files with 9 additions and 2 deletions
|
@ -63,12 +63,20 @@ namespace Bit.Core.Services
|
||||||
/// </param>
|
/// </param>
|
||||||
public async Task<bool> IsLockedAsync(string userId = null)
|
public async Task<bool> IsLockedAsync(string userId = null)
|
||||||
{
|
{
|
||||||
|
// If biometrics are used, we can use the flag to determine locked state taking into account the auto unlock key for vault timeout never.
|
||||||
|
var biometricSet = await IsBiometricLockSetAsync(userId);
|
||||||
|
var hasAutoUnlockKey = await _cryptoService.HasAutoUnlockKeyAsync(userId);
|
||||||
|
if (biometricSet && await _stateService.GetBiometricLockedAsync(userId) && !hasAutoUnlockKey)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (!await _cryptoService.HasUserKeyAsync(userId))
|
if (!await _cryptoService.HasUserKeyAsync(userId))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Filter out accounts without auto key
|
// Filter out accounts without auto key
|
||||||
if (!await _cryptoService.HasAutoUnlockKeyAsync(userId))
|
if (!hasAutoUnlockKey)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -84,7 +92,6 @@ namespace Bit.Core.Services
|
||||||
// Legacy users must migrate on web vault before login
|
// Legacy users must migrate on web vault before login
|
||||||
await LogOutAsync(false, userId);
|
await LogOutAsync(false, userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check again to verify auto key was set
|
// Check again to verify auto key was set
|
||||||
|
|
Loading…
Reference in a new issue