Reputation: 165
I have a doubt, I'm using Laravel 5.8 and I have a component in Vue that is a simple registration form. When I submit the form via POST method, Laravel doesn't request me the CSRF token, is this a normal behavior? I'm not using the API routes.
I just noticed in the Chrome storage there is a XSRF-TOKEN.
So, how is now working the CSRF validation via ajax?
Upvotes: 4
Views: 4326
Reputation: 1954
as mentioned in the laravel5.8
doc
When building JavaScript driven applications, it is convenient to have your JavaScript HTTP library automatically attach the CSRF token to every outgoing request. By default, the resources/js/bootstrap.js file registers the value of the csrf-token meta tag with the Axios HTTP library. If you are not using this library, you will need to manually configure this behavior for your application
for more information check laravel 5.8 csrf doc
.
Upvotes: 11