Answer the question
In order to leave comments, you need to log in
How to make a request to the server with csurf?
I broke my whole head how to make a trick ushali.
I'm making a vue attachment.
For the test, you need to make a post ajax request to the server on nodejs with csurf.
Tried like this:
let token = await fetch("http://site/admin/", {method:'get'}).then(data=>data.json())
let response = await fetch("http://site/admin/", {
credentials: 'same-origin',
method: 'post',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
"X-CSRF-Token": token.csrfToken
},
body: .....
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question