@@ -242,7 +242,7 @@
|
||||
let errorMessage = null;
|
||||
|
||||
try {
|
||||
const response = await fetch(url, {method: 'POST', body: formData});
|
||||
const response = await window.fetchWithCsrf(url, {method: 'POST', body: formData});
|
||||
const contentType = response.headers.get('content-type');
|
||||
|
||||
if (!response.ok) {
|
||||
|
||||
@@ -8,7 +8,6 @@ window.fetchWithCsrf = async function(url, options = {}) {
|
||||
if (cookieValue) {
|
||||
return cookieValue;
|
||||
}
|
||||
|
||||
const csrfElement = document.querySelector('input[name="_csrf"]');
|
||||
return csrfElement ? csrfElement.value : null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user