1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-28 17:27:50 +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, number: true,
minNumber: 1, minNumber: 1,
uppercase: true, uppercase: true,
minUppercase: 1, minUppercase: 0,
lowercase: true, lowercase: true,
minLowercase: 1, minLowercase: 0,
special: false, special: false,
minSpecial: 1, minSpecial: 1,
}; };
@ -35,16 +35,16 @@ export class PasswordGenerationService implements PasswordGenerationServiceAbstr
const o = Object.assign({}, DefaultOptions, options); const o = Object.assign({}, DefaultOptions, options);
// sanitize // sanitize
if (o.uppercase && o.minUppercase < 0) { if (o.uppercase && o.minUppercase <= 0) {
o.minUppercase = 1; o.minUppercase = 1;
} }
if (o.lowercase && o.minLowercase < 0) { if (o.lowercase && o.minLowercase <= 0) {
o.minLowercase = 1; o.minLowercase = 1;
} }
if (o.number && o.minNumber < 0) { if (o.number && o.minNumber <= 0) {
o.minNumber = 1; o.minNumber = 1;
} }
if (o.special && o.minSpecial < 0) { if (o.special && o.minSpecial <= 0) {
o.minSpecial = 1; o.minSpecial = 1;
} }