Try harder to identify the username used if the user have multiple entries for a website. This should help prevent false-positive banners when the user did *not* change their password, especially on multi-step login forms.

This commit is contained in:
Stefan Sundin 2022-11-14 21:02:02 -08:00
parent 2ea0fe2b97
commit 603e1d4def

View file

@ -158,6 +158,15 @@ kpxcForm.onSubmit = async function(e) {
} else if (kpxc.credentials.length === 1) {
// Single entry found for the page, use the username of it instead of an empty one
usernameValue = kpxc.credentials[0].login;
} else {
// Multiple entries found for the page, try to find out which one might have been used
const pageUuid = await sendMessage('page_get_login_id');
if (pageUuid) {
const credential = kpxc.credentials.find(c => c.uuid === pageUuid);
if (credential) {
usernameValue = credential.login;
}
}
}
// Check if the form has three password fields -> a possible password change form