Преглед изворни кода

bitwarden: filter non-logins from search

Since we're assuming that all auth-source searches are for logins, we
need to filter them out in case username is nil (which just returns all
results without looping).
Sean Farley пре 7 година
родитељ
комит
6965b0215c
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      bitwarden.el

+ 3 - 1
bitwarden.el

@@ -333,7 +333,9 @@ Returns a vector of hashtables of the results."
 ACCOUNTS can be the results of `bitwarden-search' or a string to
 search which will call `bitwarden-search' as a convenience."
   (let* ((accounts (if (vectorp accounts)
-                       accounts (bitwarden-search accounts))))
+                       accounts (bitwarden-search accounts)))
+         ;; filter out matches that are not logins
+         (accounts (seq-filter (lambda (elt) (gethash "login" elt)) accounts)))
     (if (and (stringp username) (not (string= username "")))
         (seq-filter (lambda (elt)
                       (when-let* ((login (gethash "login" elt)))