1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-05 09:10:53 +01:00

password gen fixes

This commit is contained in:
Kyle Spearrin 2018-02-09 12:08:33 -05:00
parent 28ed4144db
commit 8d4799a0a2

View File

@ -15,9 +15,9 @@ const DefaultOptions = {
number: true,
minNumber: 1,
uppercase: true,
minUppercase: 1,
minUppercase: 0,
lowercase: true,
minLowercase: 1,
minLowercase: 0,
special: false,
minSpecial: 1,
};
@ -35,16 +35,16 @@ export class PasswordGenerationService implements PasswordGenerationServiceAbstr
const o = Object.assign({}, DefaultOptions, options);
// sanitize
if (o.uppercase && o.minUppercase < 0) {
if (o.uppercase && o.minUppercase <= 0) {
o.minUppercase = 1;
}
if (o.lowercase && o.minLowercase < 0) {
if (o.lowercase && o.minLowercase <= 0) {
o.minLowercase = 1;
}
if (o.number && o.minNumber < 0) {
if (o.number && o.minNumber <= 0) {
o.minNumber = 1;
}
if (o.special && o.minSpecial < 0) {
if (o.special && o.minSpecial <= 0) {
o.minSpecial = 1;
}