Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc-browser.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvarjolintu <sami.vanttinen@protonmail.com>2022-09-17 10:32:52 +0300
committervarjolintu <sami.vanttinen@protonmail.com>2022-09-17 10:32:52 +0300
commit2c5d52b0be8659770600c459a1323e20e027e597 (patch)
treee614d4f2da38add223142373f17b6366047e76a2
parentf6cc6d342299e87fe44603c189408686bd9cea46 (diff)
Hide duplicate TOTP entryfix/hide_duplicate_totp_entry
-rwxr-xr-xkeepassxc-browser/content/keepassxc-browser.js8
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);
}