Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PM-1722] gracefully fail if site prompts user for passkey on load #6089

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions apps/browser/src/vault/fido2/content/page-script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@
abortController?: AbortController
): Promise<Credential> => {
const fallbackSupported = browserNativeWebauthnSupport;

if (options?.mediation && options.mediation !== "optional") {
coroiu marked this conversation as resolved.
Show resolved Hide resolved
throw new Error("Webauthn Conditional UI not supported in this browser.");
coroiu marked this conversation as resolved.
Show resolved Hide resolved
}

Check notice on line 102 in apps/browser/src/vault/fido2/content/page-script.ts

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (EC-598-beeep-properly-store-passkeys-in-bitwarden)

ℹ New issue: Complex Method

navigator.credentials.get has a cyclomatic complexity of 12, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
try {
const response = await messenger.request(
{
Expand Down
Loading