The key is X-CSRF-TOKEN make sure you don't mispelled it as you use it in your comment couple of times as the wrong name.
X-XSRF-TOKEN not send with axios
Hi there,
I'm on Spark 8.0.1, and everything seems to work fine, but I've noticed something about the X-XSRF-TOKEN.
On every request sent by Spark (refresh token, plans, announcements, etc...), the X-XSRF-TOKEN is automatically set and sent in the request headers.
On the other hand, in my code (using axios) it's not.
I have 2 lines as an example (one after the other):
axios.put('/spark/token');
axios.get('/spark/kiosk/regulations');
When I look at the Chrome console, the first line sends the X-XSRF-TOKEN, the second doesn't. My website still works, but the issue comes when I want to create routes in api routes, the missing X-XSRF-TOKEN from the requests (from the web pages) makes laravel respond with a 401.
Do you guys have any idea on why sometimes the X-XSRF-TOKEN is set, sometimes it's not, in request headers?
Please or to participate in this conversation.