* Use CSRF token from window.CSRF_TOKEN

* Removed unused csrftoken.js
This commit is contained in:
valtersg
2025-10-08 15:26:31 +02:00
committed by GitHub
parent e7df2f6772
commit 4afa4f721f
6 changed files with 12 additions and 35 deletions
@@ -1,8 +1,6 @@
import { getCookie } from './csrftoken.js'
import { toast } from './toast.js'
const mapping = {}
const csrftoken = getCookie('csrftoken')
document.querySelector('form#images').addEventListener('submit', async (e) => {
e.preventDefault()
@@ -11,7 +9,7 @@ document.querySelector('form#images').addEventListener('submit', async (e) => {
method: 'POST',
body: JSON.stringify(mapping),
headers: {
'X-CSRFToken': csrftoken,
'X-CSRFToken': window.CSRF_TOKEN,
'Content-Type': 'application/json'
}
})