79634041

Date: 2025-05-22 15:14:49
Score: 3
Natty:
Report link

With Sactum authentication on the Laravel API and a react js frontend app making requests using axios, i had a similar struggle. It was working well then after several changes it stopped and i started getting the error "CSRF Token Mismatch". Possibly as a result of updates, am not sure. My problem was solved by adding this line right after the imports on the component "axios.defaults.withXSRFToken = true;". Now works like a cham.

Reasons:
  • Blacklisted phrase (1): thX
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Mike