1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-19 09:43:27 +00:00

fingerprint locking

This commit is contained in:
Kyle Spearrin
2019-05-16 17:30:07 -04:00
parent 22a0b262e1
commit 5761b47073
11 changed files with 84 additions and 14 deletions

View File

@@ -47,7 +47,8 @@ namespace Bit.Core.Services
{
_key = key;
var option = await _storageService.GetAsync<int?>(Constants.LockOptionKey);
if(option.HasValue)
var fingerprint = await _storageService.GetAsync<bool?>(Constants.FingerprintUnlockKey);
if(option.HasValue && !fingerprint.GetValueOrDefault())
{
// If we have a lock option set, we do not store the key
return;
@@ -349,7 +350,8 @@ namespace Bit.Core.Services
{
var key = await GetKeyAsync();
var option = await _storageService.GetAsync<int?>(Constants.LockOptionKey);
if(option != null || option == 0)
var fingerprint = await _storageService.GetAsync<bool?>(Constants.FingerprintUnlockKey);
if(!fingerprint.GetValueOrDefault() && (option != null || option == 0))
{
await ClearKeyAsync();
_key = key;