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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user