chore: initialize public repository
CI / checks (push) Has been cancelled

This commit is contained in:
maddin
2026-03-22 12:57:09 +00:00
commit 6fbd1bb3c2
142 changed files with 19826 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
export function initCsrf() {
const tokenInput = document.querySelector('input[name="csrf_token"]');
const token = tokenInput ? tokenInput.value : null;
if (!token) {
return;
}
document.querySelectorAll('form[method="post"]').forEach((form) => {
if (!form.querySelector('input[name="csrf_token"]')) {
const hidden = document.createElement('input');
hidden.type = 'hidden';
hidden.name = 'csrf_token';
hidden.value = token;
form.appendChild(hidden);
}
});
}