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:
@@ -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>;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user