mirror of
https://github.com/bitwarden/mobile
synced 2025-12-17 16:53:26 +00:00
fingerprint unlock
This commit is contained in:
@@ -200,7 +200,8 @@ namespace Bit.App.Services
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<bool> AuthenticateFingerprintAsync(string text = null)
|
||||
public async Task<bool> AuthenticateFingerprintAsync(string text = null, string fallbackText = null,
|
||||
Action fallback = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -212,13 +213,18 @@ namespace Bit.App.Services
|
||||
var fingerprintRequest = new AuthenticationRequestConfiguration(text)
|
||||
{
|
||||
AllowAlternativeAuthentication = true,
|
||||
CancelTitle = AppResources.Cancel
|
||||
CancelTitle = AppResources.Cancel,
|
||||
FallbackTitle = fallbackText
|
||||
};
|
||||
var result = await CrossFingerprint.Current.AuthenticateAsync(fingerprintRequest);
|
||||
if(result.Authenticated)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if(result.Status == FingerprintAuthenticationResultStatus.FallbackRequested)
|
||||
{
|
||||
fallback?.Invoke();
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user