1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-06-26 10:36:21 +02:00

Bug/cme autofill unlock (#1653)

* Show SSO login if using key-connector without bio or pin

* remove additional call to enable biometrics and change method name
- ordered methods to group private and public

* allow sso for first biometric authenitcation
This commit is contained in:
Jake Fink 2021-11-19 11:24:48 -05:00 committed by GitHub
parent 94994af4a9
commit e9b0bbb3a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,6 +33,7 @@ namespace Bit.iOS.Core.Controllers
private bool _biometricLock;
private bool _biometricIntegrityValid = true;
private bool _passwordReprompt = false;
private bool _usesKeyConnector;
protected bool autofillExtension = false;
@ -80,6 +81,7 @@ namespace Bit.iOS.Core.Controllers
_cryptoService.HasKeyAsync().GetAwaiter().GetResult();
_biometricIntegrityValid = _biometricService.ValidateIntegrityAsync(BiometricIntegrityKey).GetAwaiter()
.GetResult();
_usesKeyConnector = await _keyConnectorService.GetUsesKeyConnector();
}
BaseNavItem.Title = _pinLock ? AppResources.VerifyPIN : AppResources.VerifyMasterPassword;
@ -131,16 +133,18 @@ namespace Bit.iOS.Core.Controllers
public override async void ViewDidAppear(bool animated)
{
base.ViewDidAppear(animated);
if (!_biometricLock || !_biometricIntegrityValid)
// Users with key connector and without biometric or pin has no MP to unlock with
if (_usesKeyConnector && (!(_pinLock || _biometricLock)) || ( _biometricLock && !_biometricIntegrityValid))
{
PromptSSO();
}
else if (!_biometricLock || !_biometricIntegrityValid)
{
MasterPasswordCell.TextField.BecomeFirstResponder();
}
// Users with key connector and without biometric or pin has no MP to unlock with
if (await _keyConnectorService.GetUsesKeyConnector() && !(_pinLock || _biometricLock))
{
PromptSSO();
}
}