fix min character assignments for pw gen

This commit is contained in:
Kyle Spearrin 2019-10-05 20:39:46 -04:00
parent e8130e7934
commit 83d6b2449c
1 changed files with 11 additions and 0 deletions

View File

@ -53,15 +53,26 @@ export class PasswordGenerationService implements PasswordGenerationServiceAbstr
// sanitize
if (o.uppercase && o.minUppercase <= 0) {
o.minUppercase = 1;
} else if (!o.uppercase) {
o.minUppercase = 0;
}
if (o.lowercase && o.minLowercase <= 0) {
o.minLowercase = 1;
} else if (!o.lowercase) {
o.minLowercase = 0;
}
if (o.number && o.minNumber <= 0) {
o.minNumber = 1;
} else if (!o.number) {
o.minNumber = 0;
}
if (o.special && o.minSpecial <= 0) {
o.minSpecial = 1;
} else if (!o.special) {
o.minSpecial = 0;
}
if (!o.length || o.length < 1) {