mirror of
https://github.com/bitwarden/browser
synced 2025-12-22 11:13:46 +00:00
[EC-598] feat: increment counter during assertion
This commit is contained in:
@@ -162,12 +162,19 @@ export class Fido2AuthenticatorService implements Fido2AuthenticatorServiceAbstr
|
||||
throw new Fido2AutenticatorError(Fido2AutenticatorErrorCode.NotAllowed);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const selectedCredential = await this.userInterface.pickCredential(
|
||||
const selectedCredentialId = await this.userInterface.pickCredential(
|
||||
credentialOptions.map((cipher) => cipher.id)
|
||||
);
|
||||
const selectedCredential = credentialOptions.find((c) => c.id === selectedCredentialId);
|
||||
|
||||
return null;
|
||||
if (selectedCredential === undefined) {
|
||||
throw new Fido2AutenticatorError(Fido2AutenticatorErrorCode.NotAllowed);
|
||||
}
|
||||
|
||||
++selectedCredential.fido2Key.counter;
|
||||
selectedCredential.localData.lastUsedDate = new Date().getTime();
|
||||
const encrypted = await this.cipherService.encrypt(selectedCredential);
|
||||
await this.cipherService.updateWithServer(encrypted);
|
||||
}
|
||||
|
||||
private async vaultContainsCredentials(
|
||||
|
||||
Reference in New Issue
Block a user