ended4월 16일· 1 sources

How CSRF Token Rotation Breaks Your Laravel + Inertia.js Fetches

Laravel + Inertia.js에서 CSRF 토큰 갱신이 Fetch 요청을 깨뜨리는 이유

Why it matters

When using fetch() alongside Inertia.js in Laravel, CSRF token mismatches cause 419 errors because the browser reads a stale token from the initial page load while Laravel rotates the actual token with each response. The fix involves reading the fresh token from cookies and properly handling error responses—a critical detail when integrating form submissions with client-side routing.

1
Sources
+0
24h
Growth
45d
Active
LaravelInertia.jsCSRFfetchToken rotation

Sources

Related Issues