mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
find the correct combination and field
for two-step login flows, like Google and Paypal
This commit is contained in:
parent
c82c5dd0b6
commit
b24efdcf21
1 changed files with 13 additions and 2 deletions
|
|
@ -727,7 +727,18 @@ kpxc.fillInFromActiveElement = async function(passOnly = false) {
|
|||
}
|
||||
|
||||
if (kpxc.combinations.length > 0 && kpxc.settings.autoCompleteUsernames) {
|
||||
const field = passOnly ? kpxc.combinations[0].password : kpxc.combinations[0].username;
|
||||
const combination = passOnly
|
||||
? kpxc.combinations.find(c => c.password)
|
||||
: kpxc.combinations.find(c => c.username);
|
||||
if (!combination) {
|
||||
return;
|
||||
}
|
||||
|
||||
const field = passOnly ? combination.password : combination.username;
|
||||
if (!field) {
|
||||
return;
|
||||
}
|
||||
|
||||
// set focus to the input field
|
||||
field.focus();
|
||||
|
||||
|
|
@ -737,7 +748,7 @@ kpxc.fillInFromActiveElement = async function(passOnly = false) {
|
|||
return
|
||||
} else {
|
||||
// Just one credential -> fill the first combination found
|
||||
kpxc.fillInCredentials(kpxc.combinations[0], kpxc.credentials[0].login, kpxc.credentials[0].uuid, passOnly);
|
||||
kpxc.fillInCredentials(combination, kpxc.credentials[0].login, kpxc.credentials[0].uuid, passOnly);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue