mirror of
https://github.com/bitwarden/mobile
synced 2025-12-18 09:13:15 +00:00
fingerprint locking
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user