mirror of
https://github.com/bitwarden/browser.git
synced 2025-02-23 02:31:26 +01:00
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:
parent
13bccc5a63
commit
01648e2cc3
@ -197,8 +197,8 @@ export class UserVerificationFormInputComponent implements ControlValueAccessor,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't bother executing secret changes if biometrics verification is active.
|
// Executing secret changes for all non biometrics verification. Biometrics doesn't have a user entered secret.
|
||||||
if (this.activeClientVerificationOption === ActiveClientVerificationOption.Biometrics) {
|
if (this.activeClientVerificationOption !== ActiveClientVerificationOption.Biometrics) {
|
||||||
this.processSecretChanges(this.secret.value);
|
this.processSecretChanges(this.secret.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,6 +140,10 @@ export class UserVerificationService implements UserVerificationServiceAbstracti
|
|||||||
* @param verification User-supplied verification data (OTP, MP, PIN, or biometrics)
|
* @param verification User-supplied verification data (OTP, MP, PIN, or biometrics)
|
||||||
*/
|
*/
|
||||||
async verifyUser(verification: Verification): Promise<boolean> {
|
async verifyUser(verification: Verification): Promise<boolean> {
|
||||||
|
if (verification == null) {
|
||||||
|
throw new Error("Verification is required.");
|
||||||
|
}
|
||||||
|
|
||||||
const [userId, email] = await firstValueFrom(
|
const [userId, email] = await firstValueFrom(
|
||||||
this.accountService.activeAccount$.pipe(map((a) => [a?.id, a?.email])),
|
this.accountService.activeAccount$.pipe(map((a) => [a?.id, a?.email])),
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user