mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-05 18:47:52 +01:00
async the weak password checks
This commit is contained in:
parent
c3355f7fe4
commit
a587c1d1da
@ -37,16 +37,22 @@ export class WeakPasswordsReportComponent extends CipherReportComponent implemen
|
|||||||
async setCiphers() {
|
async setCiphers() {
|
||||||
const allCiphers = await this.ciphersService.getAllDecrypted();
|
const allCiphers = await this.ciphersService.getAllDecrypted();
|
||||||
const weakPasswordCiphers: CipherView[] = [];
|
const weakPasswordCiphers: CipherView[] = [];
|
||||||
|
const promises: Array<Promise<any>> = [];
|
||||||
allCiphers.forEach((c) => {
|
allCiphers.forEach((c) => {
|
||||||
if (c.type !== CipherType.Login || c.login.password == null || c.login.password === '') {
|
if (c.type !== CipherType.Login || c.login.password == null || c.login.password === '') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const promise = new Promise((resolve) => {
|
||||||
const result = this.passwordGenerationService.passwordStrength(c.login.password);
|
const result = this.passwordGenerationService.passwordStrength(c.login.password);
|
||||||
if (result.score <= 3) {
|
if (result.score <= 3) {
|
||||||
this.passwordStrengthMap.set(c.id, this.scoreKey(result.score));
|
this.passwordStrengthMap.set(c.id, this.scoreKey(result.score));
|
||||||
weakPasswordCiphers.push(c);
|
weakPasswordCiphers.push(c);
|
||||||
}
|
}
|
||||||
|
resolve();
|
||||||
});
|
});
|
||||||
|
promises.push(promise);
|
||||||
|
});
|
||||||
|
await Promise.all(promises);
|
||||||
this.ciphers = weakPasswordCiphers;
|
this.ciphers = weakPasswordCiphers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user