mirror of
https://github.com/bitwarden/browser
synced 2026-02-05 03:03:26 +00:00
[PM-1722] gracefully fail if site prompts user for passkey on load (#6089)
* added error logic to look for options.mediation in page-script * moved the options mediation logic into the try catch. changed error to FallbackRequestedError
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { FallbackRequestedError } from "@bitwarden/common/vault/abstractions/fido2/fido2-client.service.abstraction";
|
||||
|
||||
import { WebauthnUtils } from "../../../browser/webauthn-utils";
|
||||
|
||||
import { MessageType } from "./messaging/message";
|
||||
@@ -95,7 +97,12 @@ navigator.credentials.get = async (
|
||||
abortController?: AbortController
|
||||
): Promise<Credential> => {
|
||||
const fallbackSupported = browserNativeWebauthnSupport;
|
||||
|
||||
try {
|
||||
if (options?.mediation && options.mediation !== "optional") {
|
||||
throw new FallbackRequestedError();
|
||||
}
|
||||
|
||||
const response = await messenger.request(
|
||||
{
|
||||
type: MessageType.CredentialGetRequest,
|
||||
|
||||
Reference in New Issue
Block a user