diff --git a/libs/common/src/tools/generator/password/password-generation.service.ts b/libs/common/src/tools/generator/password/password-generation.service.ts index 831ec20278e..0b37e81fdc1 100644 --- a/libs/common/src/tools/generator/password/password-generation.service.ts +++ b/libs/common/src/tools/generator/password/password-generation.service.ts @@ -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);