1
0
mirror of https://github.com/bitwarden/web synced 2025-12-21 18:53:38 +00:00

Update complexity score display (#479)

* Update complexity score

* Simplifying switch statement
This commit is contained in:
Vincent Salucci
2020-03-03 15:37:54 -06:00
committed by GitHub
parent e7e5816ded
commit 305d86f765
6 changed files with 52 additions and 6 deletions

View File

@@ -56,6 +56,23 @@ export class ChangePasswordComponent implements OnInit {
this.enforcedPolicyOptions = await this.policyService.getMasterPasswordPolicyOptions();
}
getPasswordScoreAlertDisplay() {
if (this.enforcedPolicyOptions == null) {
return '';
}
let str: string;
switch (this.enforcedPolicyOptions.minComplexity) {
case 4:
str = this.i18nService.t('strong');
case 3:
str = this.i18nService.t('good');
default:
str = this.i18nService.t('weak');
}
return str + ' (' + this.enforcedPolicyOptions.minComplexity + ')';
}
async submit() {
const hasEncKey = await this.cryptoService.hasEncKey();
if (!hasEncKey) {