Skip to content

Commit 2bf4f89

Browse files
committed
Get CSRFToken from exisitng hxHeaders, part 2.
1 parent ce6091c commit 2bf4f89

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

hypha/static_src/javascript/passkeys.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ window.hypha = window.hypha || {};
1616
window.hypha.passkeys = (function () {
1717
let _conditionalAbortController = null;
1818
function getCsrfToken() {
19-
const headers = JSON.parse(document.body.dataset.hxHeaders || "{}");
19+
const hxheaders = document.body.getAttribute("hx-headers") || "{}";
20+
const headers = JSON.parse(hxheaders);
2021
return headers["X-CSRFToken"] || "";
2122
}
2223

0 commit comments

Comments
 (0)