1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

pass gen fixes. word sep option

This commit is contained in:
Kyle Spearrin
2018-10-08 22:06:06 -04:00
parent d5f86747bf
commit a867c14b2a
2 changed files with 14 additions and 10 deletions

View File

@@ -20,9 +20,9 @@ const DefaultOptions = {
minLowercase: 0,
special: false,
minSpecial: 1,
type: 0,
type: 'password',
numWords: 3,
wordSeparator: ' ',
wordSeparator: '-',
};
const Keys = {
@@ -42,7 +42,7 @@ export class PasswordGenerationService implements PasswordGenerationServiceAbstr
// overload defaults with given options
const o = Object.assign({}, DefaultOptions, options);
if (o.type === 1) { // TODO: enum?
if (o.type === 'passphrase') {
return this.generatePassphrase(options);
}
@@ -166,7 +166,7 @@ export class PasswordGenerationService implements PasswordGenerationServiceAbstr
o.numWords = DefaultOptions.numWords;
}
if (o.wordSeparator == null || o.wordSeparator.length === 0 || o.wordSeparator.length > 1) {
o.wordSeparator = DefaultOptions.wordSeparator;
o.wordSeparator = ' ';
}
const listLength = EEFLongWordList.length - 1;