diff options
author | varjolintu <sami.vanttinen@protonmail.com> | 2022-09-17 10:32:52 +0300 |
---|---|---|
committer | varjolintu <sami.vanttinen@protonmail.com> | 2022-09-17 10:32:52 +0300 |
commit | 2c5d52b0be8659770600c459a1323e20e027e597 (patch) | |
tree | e614d4f2da38add223142373f17b6366047e76a2 | |
parent | f6cc6d342299e87fe44603c189408686bd9cea46 (diff) |
Hide duplicate TOTP entryfix/hide_duplicate_totp_entry
-rwxr-xr-x | keepassxc-browser/content/keepassxc-browser.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/keepassxc-browser/content/keepassxc-browser.js b/keepassxc-browser/content/keepassxc-browser.js index dd3a76e..d331d16 100755 --- a/keepassxc-browser/content/keepassxc-browser.js +++ b/keepassxc-browser/content/keepassxc-browser.js @@ -388,6 +388,14 @@ kpxc.initLoginPopup = function() { const loginItems = []; for (let i = 0; i < kpxc.credentials.length; i++) { const loginItem = getLoginItem(kpxc.credentials[i], showGroupNameInAutocomplete, i); + + // Ignore a duplicate entry if the password is empty, but there's already a similar entry with a password. + // An usual use case with TOTP in a separate database. + const similarEntryFound = kpxc.credentials.some(c => c.password !== '' && c.login === loginItem.login); + if (kpxc.credentials[i].password === '' && similarEntryFound) { + continue; + } + loginItems.push(loginItem); } |