add credentials same-origin

This commit is contained in:
j 2023-07-25 10:49:59 +01:00
parent 17887c05fd
commit b6c741fd05

View file

@ -38,6 +38,7 @@ async function api(url, data) {
var csrf = getCSRF() var csrf = getCSRF()
return fetch(url, { return fetch(url, {
method: 'POST', method: 'POST',
credentials: 'same-origin',
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'X-CSRFToken': csrf 'X-CSRFToken': csrf