* 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 -5
View File
@@ -1,6 +1,5 @@
import { DataSet } from 'vis-data/esnext'
import { Network } from 'vis-network/esnext'
import { getCookie } from './csrftoken.js'
const options = {
interaction: {
@@ -36,9 +35,6 @@ const options = {
}
}
// Load CSRF token
const csrftoken = getCookie('csrftoken')
// Render vis graph
let graph = null // vis graph instance
@@ -228,7 +224,7 @@ const coordSaveCheckbox = document.querySelector('#id_save_coords')
{
method: 'PATCH',
headers: {
'X-CSRFToken': csrftoken,
'X-CSRFToken': window.CSRF_TOKEN,
Accept: 'application/json',
'Content-Type': 'application/json'
},