mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Merge pull request #1146 from Rookiestyle/develop
Give TOTP field higher priority than KPH: fields when using action get-totp
This commit is contained in:
commit
169407a6f4
1 changed files with 9 additions and 9 deletions
|
|
@ -817,15 +817,7 @@ kpxc.fillFromTOTP = async function(target) {
|
|||
|
||||
if (index >= 0 && kpxc.credentials[index]) {
|
||||
// Check the value from StringFields
|
||||
if (kpxc.credentials[index].stringFields && kpxc.credentials[index].stringFields.length > 0) {
|
||||
const stringFields = kpxc.credentials[index].stringFields;
|
||||
for (const s of stringFields) {
|
||||
const val = s['KPH: {TOTP}'];
|
||||
if (val) {
|
||||
kpxc.setValue(el, val);
|
||||
}
|
||||
}
|
||||
} else if (kpxc.credentials[index].totp && kpxc.credentials[index].totp.length > 0) {
|
||||
if (kpxc.credentials[index].totp && kpxc.credentials[index].totp.length > 0) {
|
||||
// Retrieve a new TOTP value
|
||||
const totp = await sendMessage('get_totp', [ kpxc.credentials[index].uuid, kpxc.credentials[index].totp ]);
|
||||
if (!totp) {
|
||||
|
|
@ -834,6 +826,14 @@ kpxc.fillFromTOTP = async function(target) {
|
|||
}
|
||||
|
||||
kpxc.setValue(el, totp);
|
||||
} else if (kpxc.credentials[index].stringFields && kpxc.credentials[index].stringFields.length > 0) {
|
||||
const stringFields = kpxc.credentials[index].stringFields;
|
||||
for (const s of stringFields) {
|
||||
const val = s['KPH: {TOTP}'];
|
||||
if (val) {
|
||||
kpxc.setValue(el, val);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue