[PM-7255] Fix autofill cancelling the request producing inconsistent behavior (#3230)

* PM-7255 Fix autofill cancelling the request on password autofill because of wrong safeguard

* PM-7255 Clear code no longer used
This commit is contained in:
Federico Maccaroni 2024-05-08 16:54:00 -03:00 committed by GitHub
parent dee9524b2c
commit 477b1cca44
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 8 deletions

View file

@ -328,11 +328,6 @@ namespace Bit.iOS.Autofill
}
}
private bool CanProvideCredentialOnPasskeyRequest(CipherView cipherView)
{
return _context.PasskeyCredentialRequest != null && !cipherView.Login.HasFido2Credentials;
}
private void OnConfirmingNewCredential()
{
MainThread.BeginInvokeOnMainThread(() =>

View file

@ -443,14 +443,17 @@ namespace Bit.iOS.Autofill
return;
}
var decCipher = await cipher.DecryptAsync();
if (!CanProvideCredentialOnPasskeyRequest(decCipher))
if (_context.IsPasskey)
{
// this shouldn't happen but as a safeguard we've set it here:
// if somehow the flow got into here then it's impossible to find the credential identity
// i.e. if on iOS < 17 and somehow there is a PasskeyCredentialRequest that was passed along in the iOS callbacks
CancelRequest(ASExtensionErrorCode.CredentialIdentityNotFound);
return;
}
var decCipher = await cipher.DecryptAsync();
if (decCipher.Reprompt != CipherRepromptType.None)
{
// Prompt for password using either the lock screen or dialog unless