Laravel CSRF Protection: Tokens, Exceptions and SPA Pitfalls
Keep Laravel CSRF on for cookie-auth routes, put tokens in forms and AJAX headers, exclude only true third-party webhooks, and initialize Sanctum SPAs with /sanctum/csrf-cookie.
Keep Laravel CSRF on for cookie-auth routes, put tokens in forms and AJAX headers, exclude only true third-party webhooks, and initialize Sanctum SPAs with /sanctum/csrf-cookie.