From c63e50908bbe3f10fa77699a0e5e1096c4841411 Mon Sep 17 00:00:00 2001 From: Jake Fink Date: Mon, 1 Jul 2024 12:01:17 -0400 Subject: [PATCH] don't initialize kdf with validators, do it on first set (#9754) --- .../change-kdf/change-kdf.component.ts | 29 +++---------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/apps/web/src/app/auth/settings/security/change-kdf/change-kdf.component.ts b/apps/web/src/app/auth/settings/security/change-kdf/change-kdf.component.ts index 2a615ef397a..af65acc1d53 100644 --- a/apps/web/src/app/auth/settings/security/change-kdf/change-kdf.component.ts +++ b/apps/web/src/app/auth/settings/security/change-kdf/change-kdf.component.ts @@ -26,30 +26,9 @@ export class ChangeKdfComponent implements OnInit { protected formGroup = this.formBuilder.group({ kdf: new FormControl(KdfType.PBKDF2_SHA256, [Validators.required]), kdfConfig: this.formBuilder.group({ - iterations: [ - this.kdfConfig.iterations, - [ - 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), - ], - ], + iterations: [this.kdfConfig.iterations], + memory: [null as number], + parallelism: [null as number], }), }); @@ -72,7 +51,7 @@ export class ChangeKdfComponent implements OnInit { async ngOnInit() { 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.formGroup