diff options
author | 2023-11-06 17:28:25 +0000 | |
---|---|---|
committer | 2023-11-06 19:55:32 +0100 | |
commit | 2b8342fcd5aa77e2f26f9349f3b18f471bd50011 (patch) | |
tree | c60b3ce373db432f3784dd2941ef793d3e242c67 /internal/ui/static/js/app.js | |
parent | a75256bed524c203d8d44fdccf5805671471d376 (diff) | |
download | v2-2b8342fcd5aa77e2f26f9349f3b18f471bd50011.tar.gz v2-2b8342fcd5aa77e2f26f9349f3b18f471bd50011.tar.zst v2-2b8342fcd5aa77e2f26f9349f3b18f471bd50011.zip |
Refactor WebAuthn Javascript code
Diffstat (limited to 'internal/ui/static/js/app.js')
-rw-r--r-- | internal/ui/static/js/app.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/internal/ui/static/js/app.js b/internal/ui/static/js/app.js index 80781ee2..2af87dcd 100644 --- a/internal/ui/static/js/app.js +++ b/internal/ui/static/js/app.js @@ -688,4 +688,13 @@ function checkShareAPI(title, url) { console.error(err); window.location.reload(); } -}
\ No newline at end of file +} + +function getCsrfToken() { + let element = document.querySelector("body[data-csrf-token]"); + if (element !== null) { + return element.dataset.csrfToken; + } + + return ""; +} |