0๐
I can not guess the context from your call to you controller. But my headers are correctly sent using AJAX in the following format:
headers: {'x-csrf-token': $('[name=_csrf]').val()},
Alternatively, you can disable CSRF auth in the config/shield.js file, at the bottom just turn to false the enable variable, like this:
csrf: {
enable: false,
methods: ['POST', 'PUT', 'DELETE'],
filterUris: [],
cookieOptions: {
httpOnly: false,
sameSite: true,
path: '/',
maxAge: 7200
}
}
0๐
you can add your route path in filterUris like this
csrf: {
enable: true,
methods: ['POST', 'PUT', 'DELETE'],
filterUris: ['/firstroute','*',],
cookieOptions: {
httpOnly: false,
sameSite: true,
path: '/',
maxAge: 7200
}
}
more info about this check link
- [Vuejs]-Vue CLI 3 prerender-spa-plugin
- [Vuejs]-Vue-cli: Error when trying to load an image from assets folder
Source:stackexchange.com