summaryrefslogtreecommitdiffhomepage
path: root/packages/browser/src/methods/startAuthentication.ts
diff options
context:
space:
mode:
authorMatthew Miller <matthew@millerti.me>2023-10-02 23:13:02 -0700
committerGitHub <noreply@github.com>2023-10-02 23:13:02 -0700
commit7f3ea5ec5dd9e940ffcacab0a3fe5e2b621f602f (patch)
tree3864db81f0a39bd6937963f15ff0cf1c0a557442 /packages/browser/src/methods/startAuthentication.ts
parent2cf3c3540f3c05b634acd64ac921aa409ac6844e (diff)
parent24830ec796113333594832216c4cdda9843c46f7 (diff)
Merge pull request #451 from MasterKale/fix/446-enforce-conditional-ui-autocomplete-token-order
fix/446-enforce-conditional-ui-autocomplete-token-order
Diffstat (limited to 'packages/browser/src/methods/startAuthentication.ts')
-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..fdf14bf 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',
);
}