1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-22 11:13:46 +00:00

[EC-598] feat: confirm new credentials

This commit is contained in:
Andreas Coroiu
2023-03-22 10:28:28 +01:00
parent 260ea22adb
commit fbfaa06cbb
3 changed files with 43 additions and 1 deletions

View File

@@ -53,6 +53,17 @@ export class Fido2AuthenticatorService implements Fido2AuthenticatorServiceAbstr
if (params.pinAuth != undefined) {
throw new Fido2AutenticatorError(Fido2AutenticatorErrorCode.CTAP2_ERR_PIN_AUTH_INVALID);
}
if (!duplicateExists) {
const userVerification = await this.userInterface.confirmNewCredential({
credentialName: params.rp.name,
userName: params.user.name,
});
if (!userVerification) {
throw new Fido2AutenticatorError(Fido2AutenticatorErrorCode.CTAP2_ERR_OPERATION_DENIED);
}
}
}
private async vaultContainsId(ids: string[]): Promise<boolean> {