1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 15:23:33 +00:00

don't initialize kdf with validators, do it on first set (#9754)

This commit is contained in:
Jake Fink
2024-07-01 12:01:17 -04:00
committed by GitHub
parent 9551691fde
commit c63e50908b

View File

@@ -26,30 +26,9 @@ export class ChangeKdfComponent implements OnInit {
protected formGroup = this.formBuilder.group({ protected formGroup = this.formBuilder.group({
kdf: new FormControl(KdfType.PBKDF2_SHA256, [Validators.required]), kdf: new FormControl(KdfType.PBKDF2_SHA256, [Validators.required]),
kdfConfig: this.formBuilder.group({ kdfConfig: this.formBuilder.group({
iterations: [ iterations: [this.kdfConfig.iterations],
this.kdfConfig.iterations, memory: [null as number],
[ parallelism: [null as number],
Validators.required,
Validators.min(PBKDF2KdfConfig.ITERATIONS.min),
Validators.max(PBKDF2KdfConfig.ITERATIONS.max),
],
],
memory: [
null as number,
[
Validators.required,
Validators.min(Argon2KdfConfig.MEMORY.min),
Validators.max(Argon2KdfConfig.MEMORY.max),
],
],
parallelism: [
null as number,
[
Validators.required,
Validators.min(Argon2KdfConfig.PARALLELISM.min),
Validators.max(Argon2KdfConfig.PARALLELISM.max),
],
],
}), }),
}); });
@@ -72,7 +51,7 @@ export class ChangeKdfComponent implements OnInit {
async ngOnInit() { async ngOnInit() {
this.kdfConfig = await this.kdfConfigService.getKdfConfig(); this.kdfConfig = await this.kdfConfigService.getKdfConfig();
this.formGroup.get("kdf").setValue(this.kdfConfig.kdfType, { emitEvent: false }); this.formGroup.get("kdf").setValue(this.kdfConfig.kdfType);
this.setFormControlValues(this.kdfConfig); this.setFormControlValues(this.kdfConfig);
this.formGroup this.formGroup