summaryrefslogtreecommitdiff
path: root/srv/src/http/tpl/load-csrf.html
diff options
context:
space:
mode:
Diffstat (limited to 'srv/src/http/tpl/load-csrf.html')
-rw-r--r--srv/src/http/tpl/load-csrf.html13
1 files changed, 13 insertions, 0 deletions
diff --git a/srv/src/http/tpl/load-csrf.html b/srv/src/http/tpl/load-csrf.html
new file mode 100644
index 0000000..b0757f9
--- /dev/null
+++ b/srv/src/http/tpl/load-csrf.html
@@ -0,0 +1,13 @@
+<script async type="module" src="{{ StaticURL "api.js" }}"></script>
+
+<script type="text/javascript">
+ (async () => {
+ const api = await import("{{ StaticURL "api.js" }}");
+ const res = await api.call("/api/csrf");
+
+ const els = document.getElementsByClassName("csrfHiddenInput");
+ for (let i = 0; i < els.length; i++) {
+ els[i].value = res.CSRFToken;
+ }
+ })();
+</script>