1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-20 03:13:55 +00:00

Throw if silent assert request requires showing UI

This commit is contained in:
Isaiah Inuwa
2026-01-12 13:52:46 -06:00
parent c1c8ff295b
commit 9f0ae4b799
5 changed files with 38 additions and 11 deletions

View File

@@ -153,8 +153,14 @@ export interface Fido2AuthenticatorGetAssertionParams {
/** Forwarded to user interface */
fallbackSupported: boolean;
// Bypass the UI and assume that the user has already interacted with the authenticator
/** Bypass the UI and assume that the user has already interacted with the authenticator */
assumeUserPresence?: boolean;
/** Signals whether an error should be thrown if an assertion cannot be obtained without showing Bitwarden UI.
*
* Note that OS user verification prompts are allowed in silent requests.
*/
isSilent?: boolean;
}
export interface Fido2AuthenticatorGetAssertionResult {

View File

@@ -50,6 +50,12 @@ export interface PickCredentialParams {
* Identifies whether a cipher requires a master password reprompt when getting a credential.
*/
masterPasswordRepromptRequired?: boolean;
/** Signals whether an error should be thrown if an assertion cannot be obtained without showing Bitwarden UI.
*
* Note that OS user verification prompts are allowed in silent requests.
*/
isSilent?: boolean;
}
/**
@@ -121,3 +127,6 @@ export abstract class Fido2UserInterfaceSession {
*/
abstract close(): void;
}
/** Thrown when user interaction is required during a request for a silent assertion. */
export class UserInteractionRequired extends Error {}

View File

@@ -291,6 +291,7 @@ export class Fido2AuthenticatorService<
userVerification: params.requireUserVerification,
assumeUserPresence: params.assumeUserPresence,
masterPasswordRepromptRequired,
isSilent: params.isSilent,
});
}