Skip to content

Commit

Permalink
fix: cancel conditional passkey before trying again
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Dec 17, 2024
1 parent 0d1d003 commit 87b4e59
Show file tree
Hide file tree
Showing 27 changed files with 32 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"async": true,
"crossorigin": "anonymous",
"id": "webauthn_script",
"integrity": "sha512-3Z1fDRo1yulzEUWcPb/35UhuKYyNgM/z70Pnidfr1pQGtRZz2xaFinaEyIiolwRTx+0B43ATFQcMsyaDJxC0tA==",
"integrity": "sha512-Jx6GWn7X7TtzIP+BIRnTzYIRjoqb6txB2kvBg680cPQ/XXyHg0CL2bywYjJ1szJh+YZqLrMgHyltXBihTkq3mA==",
"node_type": "script",
"referrerpolicy": "no-referrer",
"type": "text/javascript"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"async": true,
"crossorigin": "anonymous",
"id": "webauthn_script",
"integrity": "sha512-3Z1fDRo1yulzEUWcPb/35UhuKYyNgM/z70Pnidfr1pQGtRZz2xaFinaEyIiolwRTx+0B43ATFQcMsyaDJxC0tA==",
"integrity": "sha512-Jx6GWn7X7TtzIP+BIRnTzYIRjoqb6txB2kvBg680cPQ/XXyHg0CL2bywYjJ1szJh+YZqLrMgHyltXBihTkq3mA==",
"node_type": "script",
"referrerpolicy": "no-referrer",
"type": "text/javascript"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"async": true,
"crossorigin": "anonymous",
"id": "webauthn_script",
"integrity": "sha512-3Z1fDRo1yulzEUWcPb/35UhuKYyNgM/z70Pnidfr1pQGtRZz2xaFinaEyIiolwRTx+0B43ATFQcMsyaDJxC0tA==",
"integrity": "sha512-Jx6GWn7X7TtzIP+BIRnTzYIRjoqb6txB2kvBg680cPQ/XXyHg0CL2bywYjJ1szJh+YZqLrMgHyltXBihTkq3mA==",
"node_type": "script",
"referrerpolicy": "no-referrer",
"type": "text/javascript"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"async": true,
"crossorigin": "anonymous",
"id": "webauthn_script",
"integrity": "sha512-3Z1fDRo1yulzEUWcPb/35UhuKYyNgM/z70Pnidfr1pQGtRZz2xaFinaEyIiolwRTx+0B43ATFQcMsyaDJxC0tA==",
"integrity": "sha512-Jx6GWn7X7TtzIP+BIRnTzYIRjoqb6txB2kvBg680cPQ/XXyHg0CL2bywYjJ1szJh+YZqLrMgHyltXBihTkq3mA==",
"node_type": "script",
"referrerpolicy": "no-referrer",
"type": "text/javascript"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"async": true,
"crossorigin": "anonymous",
"id": "webauthn_script",
"integrity": "sha512-3Z1fDRo1yulzEUWcPb/35UhuKYyNgM/z70Pnidfr1pQGtRZz2xaFinaEyIiolwRTx+0B43ATFQcMsyaDJxC0tA==",
"integrity": "sha512-Jx6GWn7X7TtzIP+BIRnTzYIRjoqb6txB2kvBg680cPQ/XXyHg0CL2bywYjJ1szJh+YZqLrMgHyltXBihTkq3mA==",
"node_type": "script",
"referrerpolicy": "no-referrer",
"type": "text/javascript"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"async": true,
"referrerpolicy": "no-referrer",
"crossorigin": "anonymous",
"integrity": "sha512-3Z1fDRo1yulzEUWcPb/35UhuKYyNgM/z70Pnidfr1pQGtRZz2xaFinaEyIiolwRTx+0B43ATFQcMsyaDJxC0tA==",
"integrity": "sha512-Jx6GWn7X7TtzIP+BIRnTzYIRjoqb6txB2kvBg680cPQ/XXyHg0CL2bywYjJ1szJh+YZqLrMgHyltXBihTkq3mA==",
"type": "text/javascript",
"id": "webauthn_script",
"node_type": "script"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"async": true,
"referrerpolicy": "no-referrer",
"crossorigin": "anonymous",
"integrity": "sha512-3Z1fDRo1yulzEUWcPb/35UhuKYyNgM/z70Pnidfr1pQGtRZz2xaFinaEyIiolwRTx+0B43ATFQcMsyaDJxC0tA==",
"integrity": "sha512-Jx6GWn7X7TtzIP+BIRnTzYIRjoqb6txB2kvBg680cPQ/XXyHg0CL2bywYjJ1szJh+YZqLrMgHyltXBihTkq3mA==",
"type": "text/javascript",
"id": "webauthn_script",
"node_type": "script"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"async": true,
"referrerpolicy": "no-referrer",
"crossorigin": "anonymous",
"integrity": "sha512-3Z1fDRo1yulzEUWcPb/35UhuKYyNgM/z70Pnidfr1pQGtRZz2xaFinaEyIiolwRTx+0B43ATFQcMsyaDJxC0tA==",
"integrity": "sha512-Jx6GWn7X7TtzIP+BIRnTzYIRjoqb6txB2kvBg680cPQ/XXyHg0CL2bywYjJ1szJh+YZqLrMgHyltXBihTkq3mA==",
"type": "text/javascript",
"id": "webauthn_script",
"node_type": "script"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"async": true,
"crossorigin": "anonymous",
"id": "webauthn_script",
"integrity": "sha512-3Z1fDRo1yulzEUWcPb/35UhuKYyNgM/z70Pnidfr1pQGtRZz2xaFinaEyIiolwRTx+0B43ATFQcMsyaDJxC0tA==",
"integrity": "sha512-Jx6GWn7X7TtzIP+BIRnTzYIRjoqb6txB2kvBg680cPQ/XXyHg0CL2bywYjJ1szJh+YZqLrMgHyltXBihTkq3mA==",
"node_type": "script",
"referrerpolicy": "no-referrer",
"type": "text/javascript"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"async": true,
"crossorigin": "anonymous",
"id": "webauthn_script",
"integrity": "sha512-3Z1fDRo1yulzEUWcPb/35UhuKYyNgM/z70Pnidfr1pQGtRZz2xaFinaEyIiolwRTx+0B43ATFQcMsyaDJxC0tA==",
"integrity": "sha512-Jx6GWn7X7TtzIP+BIRnTzYIRjoqb6txB2kvBg680cPQ/XXyHg0CL2bywYjJ1szJh+YZqLrMgHyltXBihTkq3mA==",
"node_type": "script",
"referrerpolicy": "no-referrer",
"type": "text/javascript"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"async": true,
"crossorigin": "anonymous",
"id": "webauthn_script",
"integrity": "sha512-3Z1fDRo1yulzEUWcPb/35UhuKYyNgM/z70Pnidfr1pQGtRZz2xaFinaEyIiolwRTx+0B43ATFQcMsyaDJxC0tA==",
"integrity": "sha512-Jx6GWn7X7TtzIP+BIRnTzYIRjoqb6txB2kvBg680cPQ/XXyHg0CL2bywYjJ1szJh+YZqLrMgHyltXBihTkq3mA==",
"node_type": "script",
"referrerpolicy": "no-referrer",
"type": "text/javascript"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"async": true,
"referrerpolicy": "no-referrer",
"crossorigin": "anonymous",
"integrity": "sha512-3Z1fDRo1yulzEUWcPb/35UhuKYyNgM/z70Pnidfr1pQGtRZz2xaFinaEyIiolwRTx+0B43ATFQcMsyaDJxC0tA==",
"integrity": "sha512-Jx6GWn7X7TtzIP+BIRnTzYIRjoqb6txB2kvBg680cPQ/XXyHg0CL2bywYjJ1szJh+YZqLrMgHyltXBihTkq3mA==",
"type": "text/javascript",
"node_type": "script"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"async": true,
"referrerpolicy": "no-referrer",
"crossorigin": "anonymous",
"integrity": "sha512-3Z1fDRo1yulzEUWcPb/35UhuKYyNgM/z70Pnidfr1pQGtRZz2xaFinaEyIiolwRTx+0B43ATFQcMsyaDJxC0tA==",
"integrity": "sha512-Jx6GWn7X7TtzIP+BIRnTzYIRjoqb6txB2kvBg680cPQ/XXyHg0CL2bywYjJ1szJh+YZqLrMgHyltXBihTkq3mA==",
"type": "text/javascript",
"node_type": "script"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"async": true,
"crossorigin": "anonymous",
"id": "webauthn_script",
"integrity": "sha512-3Z1fDRo1yulzEUWcPb/35UhuKYyNgM/z70Pnidfr1pQGtRZz2xaFinaEyIiolwRTx+0B43ATFQcMsyaDJxC0tA==",
"integrity": "sha512-Jx6GWn7X7TtzIP+BIRnTzYIRjoqb6txB2kvBg680cPQ/XXyHg0CL2bywYjJ1szJh+YZqLrMgHyltXBihTkq3mA==",
"node_type": "script",
"referrerpolicy": "no-referrer",
"type": "text/javascript"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"async": true,
"crossorigin": "anonymous",
"id": "webauthn_script",
"integrity": "sha512-3Z1fDRo1yulzEUWcPb/35UhuKYyNgM/z70Pnidfr1pQGtRZz2xaFinaEyIiolwRTx+0B43ATFQcMsyaDJxC0tA==",
"integrity": "sha512-Jx6GWn7X7TtzIP+BIRnTzYIRjoqb6txB2kvBg680cPQ/XXyHg0CL2bywYjJ1szJh+YZqLrMgHyltXBihTkq3mA==",
"node_type": "script",
"referrerpolicy": "no-referrer",
"type": "text/javascript"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"async": true,
"crossorigin": "anonymous",
"id": "webauthn_script",
"integrity": "sha512-3Z1fDRo1yulzEUWcPb/35UhuKYyNgM/z70Pnidfr1pQGtRZz2xaFinaEyIiolwRTx+0B43ATFQcMsyaDJxC0tA==",
"integrity": "sha512-Jx6GWn7X7TtzIP+BIRnTzYIRjoqb6txB2kvBg680cPQ/XXyHg0CL2bywYjJ1szJh+YZqLrMgHyltXBihTkq3mA==",
"node_type": "script",
"referrerpolicy": "no-referrer",
"type": "text/javascript"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"async": true,
"crossorigin": "anonymous",
"id": "webauthn_script",
"integrity": "sha512-3Z1fDRo1yulzEUWcPb/35UhuKYyNgM/z70Pnidfr1pQGtRZz2xaFinaEyIiolwRTx+0B43ATFQcMsyaDJxC0tA==",
"integrity": "sha512-Jx6GWn7X7TtzIP+BIRnTzYIRjoqb6txB2kvBg680cPQ/XXyHg0CL2bywYjJ1szJh+YZqLrMgHyltXBihTkq3mA==",
"node_type": "script",
"referrerpolicy": "no-referrer",
"type": "text/javascript"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"async": true,
"crossorigin": "anonymous",
"id": "webauthn_script",
"integrity": "sha512-3Z1fDRo1yulzEUWcPb/35UhuKYyNgM/z70Pnidfr1pQGtRZz2xaFinaEyIiolwRTx+0B43ATFQcMsyaDJxC0tA==",
"integrity": "sha512-Jx6GWn7X7TtzIP+BIRnTzYIRjoqb6txB2kvBg680cPQ/XXyHg0CL2bywYjJ1szJh+YZqLrMgHyltXBihTkq3mA==",
"node_type": "script",
"referrerpolicy": "no-referrer",
"type": "text/javascript"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"async": true,
"crossorigin": "anonymous",
"id": "webauthn_script",
"integrity": "sha512-3Z1fDRo1yulzEUWcPb/35UhuKYyNgM/z70Pnidfr1pQGtRZz2xaFinaEyIiolwRTx+0B43ATFQcMsyaDJxC0tA==",
"integrity": "sha512-Jx6GWn7X7TtzIP+BIRnTzYIRjoqb6txB2kvBg680cPQ/XXyHg0CL2bywYjJ1szJh+YZqLrMgHyltXBihTkq3mA==",
"node_type": "script",
"referrerpolicy": "no-referrer",
"type": "text/javascript"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
"async": true,
"crossorigin": "anonymous",
"id": "webauthn_script",
"integrity": "sha512-3Z1fDRo1yulzEUWcPb/35UhuKYyNgM/z70Pnidfr1pQGtRZz2xaFinaEyIiolwRTx+0B43ATFQcMsyaDJxC0tA==",
"integrity": "sha512-Jx6GWn7X7TtzIP+BIRnTzYIRjoqb6txB2kvBg680cPQ/XXyHg0CL2bywYjJ1szJh+YZqLrMgHyltXBihTkq3mA==",
"node_type": "script",
"referrerpolicy": "no-referrer",
"type": "text/javascript"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"async": true,
"crossorigin": "anonymous",
"id": "webauthn_script",
"integrity": "sha512-3Z1fDRo1yulzEUWcPb/35UhuKYyNgM/z70Pnidfr1pQGtRZz2xaFinaEyIiolwRTx+0B43ATFQcMsyaDJxC0tA==",
"integrity": "sha512-Jx6GWn7X7TtzIP+BIRnTzYIRjoqb6txB2kvBg680cPQ/XXyHg0CL2bywYjJ1szJh+YZqLrMgHyltXBihTkq3mA==",
"node_type": "script",
"referrerpolicy": "no-referrer",
"type": "text/javascript"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"async": true,
"referrerpolicy": "no-referrer",
"crossorigin": "anonymous",
"integrity": "sha512-3Z1fDRo1yulzEUWcPb/35UhuKYyNgM/z70Pnidfr1pQGtRZz2xaFinaEyIiolwRTx+0B43ATFQcMsyaDJxC0tA==",
"integrity": "sha512-Jx6GWn7X7TtzIP+BIRnTzYIRjoqb6txB2kvBg680cPQ/XXyHg0CL2bywYjJ1szJh+YZqLrMgHyltXBihTkq3mA==",
"type": "text/javascript",
"id": "webauthn_script",
"node_type": "script"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"async": true,
"referrerpolicy": "no-referrer",
"crossorigin": "anonymous",
"integrity": "sha512-3Z1fDRo1yulzEUWcPb/35UhuKYyNgM/z70Pnidfr1pQGtRZz2xaFinaEyIiolwRTx+0B43ATFQcMsyaDJxC0tA==",
"integrity": "sha512-Jx6GWn7X7TtzIP+BIRnTzYIRjoqb6txB2kvBg680cPQ/XXyHg0CL2bywYjJ1szJh+YZqLrMgHyltXBihTkq3mA==",
"type": "text/javascript",
"id": "webauthn_script",
"node_type": "script"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"async": true,
"referrerpolicy": "no-referrer",
"crossorigin": "anonymous",
"integrity": "sha512-3Z1fDRo1yulzEUWcPb/35UhuKYyNgM/z70Pnidfr1pQGtRZz2xaFinaEyIiolwRTx+0B43ATFQcMsyaDJxC0tA==",
"integrity": "sha512-Jx6GWn7X7TtzIP+BIRnTzYIRjoqb6txB2kvBg680cPQ/XXyHg0CL2bywYjJ1szJh+YZqLrMgHyltXBihTkq3mA==",
"type": "text/javascript",
"id": "webauthn_script",
"node_type": "script"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"async": true,
"crossorigin": "anonymous",
"id": "webauthn_script",
"integrity": "sha512-3Z1fDRo1yulzEUWcPb/35UhuKYyNgM/z70Pnidfr1pQGtRZz2xaFinaEyIiolwRTx+0B43ATFQcMsyaDJxC0tA==",
"integrity": "sha512-Jx6GWn7X7TtzIP+BIRnTzYIRjoqb6txB2kvBg680cPQ/XXyHg0CL2bywYjJ1szJh+YZqLrMgHyltXBihTkq3mA==",
"node_type": "script",
"referrerpolicy": "no-referrer",
"type": "text/javascript"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"async": true,
"crossorigin": "anonymous",
"id": "webauthn_script",
"integrity": "sha512-3Z1fDRo1yulzEUWcPb/35UhuKYyNgM/z70Pnidfr1pQGtRZz2xaFinaEyIiolwRTx+0B43ATFQcMsyaDJxC0tA==",
"integrity": "sha512-Jx6GWn7X7TtzIP+BIRnTzYIRjoqb6txB2kvBg680cPQ/XXyHg0CL2bywYjJ1szJh+YZqLrMgHyltXBihTkq3mA==",
"node_type": "script",
"referrerpolicy": "no-referrer",
"type": "text/javascript"
Expand Down
7 changes: 6 additions & 1 deletion x/webauthnx/js/webauthn.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@
}
opt.publicKey.challenge = __oryWebAuthnBufferDecode(opt.publicKey.challenge)

// If this is set we already have a request ongoing which we need to abort.
window.abortPasskeyConditionalUI &&
window.abortPasskeyConditionalUI.abort(
"Canceling Passkey autocomplete to complete trigger-based passkey login.",
)

// Allow aborting through a global variable
window.abortPasskeyConditionalUI = new AbortController()

Expand All @@ -182,7 +188,6 @@
signal: abortPasskeyConditionalUI.signal,
})
.then(function (credential) {
console.trace(credential)
resultEl.value = JSON.stringify({
id: credential.id,
rawId: __oryWebAuthnBufferEncode(credential.rawId),
Expand Down

0 comments on commit 87b4e59

Please sign in to comment.