Auth/PM-8358 - User Verification dialog & form input fix for empty submit displaying wrong error (#9363)

* PM-8358 - UserVerificatonFormInput - fix incorrect init logic. We needed to execute the processSecretChanges logic to convert null into { type: 0, secret: null }  (VerificationWithSecret) for all non-biometric verification flows. .

* PM-8358 - UserVerificationService - verifyUser(...) - throw error if called with null. It should only happen if a dev makes a mistake in theory.
This commit is contained in:
Jared Snider 2024-06-03 10:15:11 -04:00 committed by GitHub
parent 13bccc5a63
commit 01648e2cc3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -197,8 +197,8 @@ export class UserVerificationFormInputComponent implements ControlValueAccessor,
}
}
// Don't bother executing secret changes if biometrics verification is active.
if (this.activeClientVerificationOption === ActiveClientVerificationOption.Biometrics) {
// Executing secret changes for all non biometrics verification. Biometrics doesn't have a user entered secret.
if (this.activeClientVerificationOption !== ActiveClientVerificationOption.Biometrics) {
this.processSecretChanges(this.secret.value);
}

View File

@ -140,6 +140,10 @@ export class UserVerificationService implements UserVerificationServiceAbstracti
* @param verification User-supplied verification data (OTP, MP, PIN, or biometrics)
*/
async verifyUser(verification: Verification): Promise<boolean> {
if (verification == null) {
throw new Error("Verification is required.");
}
const [userId, email] = await firstValueFrom(
this.accountService.activeAccount$.pipe(map((a) => [a?.id, a?.email])),
);