Merge pull request #1350 from keepassxreboot/fix/totp_filling

TOTP filling fixes
This commit is contained in:
Sami Vänttinen 2021-06-19 14:15:03 +03:00 committed by GitHub
commit 3db23e9452
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -889,7 +889,7 @@ kpxc.fillInFromActiveElement = async function(passOnly = false) {
return;
}
// set focus to the input field
// Set focus to the input field
field.focus();
if (kpxc.credentials.length > 1) {
@ -898,6 +898,7 @@ kpxc.fillInFromActiveElement = async function(passOnly = false) {
return;
} else {
// Just one credential -> fill the first combination found
await sendMessage('page_set_login_id', kpxc.credentials[0].uuid);
kpxc.fillInCredentials(combination, kpxc.credentials[0].login, kpxc.credentials[0].uuid, passOnly);
return;
}
@ -920,7 +921,7 @@ kpxc.fillInFromActiveElement = async function(passOnly = false) {
return;
}
await sendMessage('page_set_login_id', '');
await sendMessage('page_set_login_id', kpxc.credentials[0].uuid);
kpxc.fillInCredentials(combination, kpxc.credentials[0].login, kpxc.credentials[0].uuid, passOnly);
};
@ -931,7 +932,7 @@ kpxc.fillFromAutofill = async function() {
}
const index = kpxc.combinations.length - 1;
await sendMessage('page_set_login_id', '');
await sendMessage('page_set_login_id', kpxc.credentials[0].uuid);
kpxc.fillInCredentials(kpxc.combinations[index], kpxc.credentials[0].login, kpxc.credentials[0].uuid);
// Generate popup-list of usernames + descriptions
@ -1041,7 +1042,7 @@ kpxc.fillFromUsernameIcon = async function(combination) {
return;
}
await sendMessage('page_set_login_id', '');
await sendMessage('page_set_login_id', kpxc.credentials[0].uuid);
kpxc.fillInCredentials(combination, kpxc.credentials[0].login, kpxc.credentials[0].uuid);
};
@ -1710,7 +1711,7 @@ kpxc.updateDatabaseState = async function() {
// Updates the TOTP Autocomplete Menu
kpxc.updateTOTPList = async function() {
let uuid = await sendMessage('page_get_login_id');
if (uuid === undefined) {
if (uuid === undefined || kpxc.credentials.length === 0) {
// Credential haven't been selected
return;
}