mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-21 16:18:28 +01:00
check credential type explicitly when loading evaluator (#7791)
This commit is contained in:
parent
bb031f6779
commit
64381cbae0
@ -195,9 +195,10 @@ export class PasswordGenerationService implements PasswordGenerationServiceAbstr
|
||||
options.type = policy.defaultType;
|
||||
}
|
||||
|
||||
const evaluator = options.type
|
||||
? new PasswordGeneratorOptionsEvaluator(policy)
|
||||
: new PassphraseGeneratorOptionsEvaluator(policy);
|
||||
const evaluator =
|
||||
options.type == "password"
|
||||
? new PasswordGeneratorOptionsEvaluator(policy)
|
||||
: new PassphraseGeneratorOptionsEvaluator(policy);
|
||||
|
||||
// Ensure the options to pass the current rules
|
||||
const withPolicy = evaluator.applyPolicy(options);
|
||||
@ -344,9 +345,10 @@ export class PasswordGenerationService implements PasswordGenerationServiceAbstr
|
||||
options: PasswordGeneratorOptions,
|
||||
enforcedPolicyOptions: PasswordGeneratorPolicyOptions,
|
||||
) {
|
||||
const evaluator = options.type
|
||||
? new PasswordGeneratorOptionsEvaluator(enforcedPolicyOptions)
|
||||
: new PassphraseGeneratorOptionsEvaluator(enforcedPolicyOptions);
|
||||
const evaluator =
|
||||
options.type == "password"
|
||||
? new PasswordGeneratorOptionsEvaluator(enforcedPolicyOptions)
|
||||
: new PassphraseGeneratorOptionsEvaluator(enforcedPolicyOptions);
|
||||
|
||||
const evaluatedOptions = evaluator.applyPolicy(options);
|
||||
const santizedOptions = evaluator.sanitize(evaluatedOptions);
|
||||
|
Loading…
Reference in New Issue
Block a user