1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 16:23:44 +00:00

[EC-598] feat: differntiate between resident auth and 2fa

This commit is contained in:
Andreas Coroiu
2023-01-05 15:29:24 +01:00
parent 132c3fe04d
commit f7a74c8cf2
6 changed files with 66 additions and 9 deletions

View File

@@ -3,6 +3,7 @@ export interface NewCredentialParams {
}
export abstract class Fido2UserInterfaceService {
confirmCredential: (cipherId: string) => Promise<boolean>;
pickCredential: (cipherIds: string[]) => Promise<string>;
confirmNewCredential: (params: NewCredentialParams) => Promise<boolean>;
}

View File

@@ -129,7 +129,7 @@ export class Fido2Service implements Fido2ServiceAbstraction {
throw new OriginMismatchError();
}
await this.fido2UserInterfaceService.pickCredential([credential.credentialId.encoded]);
await this.fido2UserInterfaceService.confirmCredential(credential.credentialId.encoded);
} else {
// We're looking for a resident key
const credentials = await this.getCredentialsByRp(params.rpId);

View File

@@ -2,6 +2,10 @@ import { Fido2UserInterfaceService as Fido2UserInterfaceServiceAbstraction } fro
import { RequestAbortedError } from "../../abstractions/fido2/fido2.service.abstraction";
export class Fido2UserInterfaceService implements Fido2UserInterfaceServiceAbstraction {
async confirmCredential(cipherId: string): Promise<boolean> {
return false;
}
pickCredential(cipherIds: string[]): Promise<string> {
throw new RequestAbortedError();
}