1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-26 17:08:33 +01:00

Show policy in effect banner for password generator (#76)

This commit is contained in:
Vincent Salucci 2020-02-28 11:09:57 -06:00 committed by GitHub
parent 862057dca6
commit 6c52942204
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,6 +79,24 @@ export class PasswordGeneratorComponent implements OnInit {
this.showOptions = !this.showOptions;
}
hasPolicyInEffect() {
if (this.enforcedPolicyOptions == null) {
return false;
}
if (this.enforcedPolicyOptions.minLength > 0
|| this.enforcedPolicyOptions.numberCount > 0
|| this.enforcedPolicyOptions.specialCount > 0
|| this.enforcedPolicyOptions.useUppercase
|| this.enforcedPolicyOptions.useLowercase
|| this.enforcedPolicyOptions.useNumbers
|| this.enforcedPolicyOptions.useSpecial) {
return true;
} else {
return false;
}
}
private normalizeOptions() {
this.options.minLowercase = 0;
this.options.minUppercase = 0;