From e9b0bbb3a91589f562d571f37105a3195990d3ac Mon Sep 17 00:00:00 2001 From: Jake Fink Date: Fri, 19 Nov 2021 11:24:48 -0500 Subject: [PATCH] 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 --- .../Controllers/LockPasswordViewController.cs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/iOS.Core/Controllers/LockPasswordViewController.cs b/src/iOS.Core/Controllers/LockPasswordViewController.cs index 36a57991c..63fbb6eb2 100644 --- a/src/iOS.Core/Controllers/LockPasswordViewController.cs +++ b/src/iOS.Core/Controllers/LockPasswordViewController.cs @@ -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(); - } + }