1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-13 23:03:32 +00:00

detech password changes with 2 equal passwords

This commit is contained in:
Kyle Spearrin
2018-09-07 08:01:50 -04:00
parent 768aab2bf8
commit d2e5c9b6ea
2 changed files with 25 additions and 10 deletions

View File

@@ -316,10 +316,18 @@ export default class RuntimeBackground {
return;
}
let id: string = null;
const ciphers = await this.cipherService.getAllDecryptedForUrl(changeData.url);
const passwordMatches = ciphers.filter((c) => c.login.password === changeData.currentPassword);
if (passwordMatches.length === 1) {
this.addChangedPasswordToQueue(passwordMatches[0].id, loginDomain, changeData.newPassword, tab);
if (changeData.currentPassword != null) {
const passwordMatches = ciphers.filter((c) => c.login.password === changeData.currentPassword);
if (passwordMatches.length === 1) {
id = passwordMatches[0].id;
}
} else if (ciphers.length === 1) {
id = ciphers[0].id;
}
if (id != null) {
this.addChangedPasswordToQueue(id, loginDomain, changeData.newPassword, tab);
}
}