summaryrefslogtreecommitdiffhomepage
path: root/packages/browser/src/methods
diff options
context:
space:
mode:
authorMatthew Miller <matthew@millerti.me>2023-10-02 23:01:38 -0700
committerMatthew Miller <matthew@millerti.me>2023-10-02 23:01:38 -0700
commit798a8fa184d9787aaa3eb8d15a10f31277479e3e (patch)
treeafe2c0385c8d3d7fa4c5da355e0fd7b501a288c8 /packages/browser/src/methods
parent2cf3c3540f3c05b634acd64ac921aa409ac6844e (diff)
Require "webauthn" be solo or at the end
Diffstat (limited to 'packages/browser/src/methods')
-rw-r--r--packages/browser/src/methods/startAuthentication.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/browser/src/methods/startAuthentication.ts b/packages/browser/src/methods/startAuthentication.ts
index 6e3940d..2c95a34 100644
--- a/packages/browser/src/methods/startAuthentication.ts
+++ b/packages/browser/src/methods/startAuthentication.ts
@@ -59,13 +59,13 @@ export async function startAuthentication(
// Check for an <input> with "webauthn" in its `autocomplete` attribute
const eligibleInputs = document.querySelectorAll(
- 'input[autocomplete*=\'webauthn\']',
+ 'input[autocomplete$=\'webauthn\']',
);
// WebAuthn autofill requires at least one valid input
if (eligibleInputs.length < 1) {
throw Error(
- 'No <input> with `"webauthn"` in its `autocomplete` attribute was detected',
+ 'No <input> with `"webauthn"` as the only or last value in its `autocomplete` attribute was detected',
);
}