I was trying to build an api backend and a ReactJS frontend. However, whenever I attempt to login, I always get 419 response code, which I am aware is about the csrf token but I don't know what to change in my code.
#419 response code
16 messages · Page 1 of 1 (latest)
how are you trying to login
can you show me whole of boostrap.js
and session.php config file
If you're on a 1.6.2 version of axios or higher the behaviour around the X-XSRF-TOKEN header changed.
axios.defaults.withCredentials = true;
axios.defaults.withXSRFToken = true;
yeha i was looking for that, and making sure he had set domain in session.php x
I dont have this file
nah its fine u don't have to its just default
axios.defaults.withCredentials = true;
axios.defaults.withXSRFToken = true;
i was just wondering if u had that ^^
I just put that and 419 is now gone and had been replaced by 500 error status code
Do you still need the session file?
Laravel 11 doesn't have this config file by default, you can publish it however. I don't think you should include the scheme in the SESSION_DOMAIN or STATEFUL_DOMAINS however
I am currently using v10.* 🙂