1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-18 09:13:15 +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

@@ -200,29 +200,25 @@ namespace Bit.App.Services
}
}
public async Task<bool> AuthenticateFingerprintAsync(string text = null, Action fallback = null)
public async Task<bool> AuthenticateFingerprintAsync(string text = null)
{
try
{
if(text == null)
{
text = AppResources.FingerprintDirection;
// TODO: face id direction
}
var fingerprintRequest = new AuthenticationRequestConfiguration(text)
{
AllowAlternativeAuthentication = true,
CancelTitle = AppResources.Cancel,
FallbackTitle = AppResources.LogOut
CancelTitle = AppResources.Cancel
};
var result = await CrossFingerprint.Current.AuthenticateAsync(fingerprintRequest);
if(result.Authenticated)
{
return true;
}
else if(result.Status == FingerprintAuthenticationResultStatus.FallbackRequested)
{
fallback?.Invoke();
}
}
catch { }
return false;