feat(security): check the CSRF token in the pipeline, in observation mode
CsrfMiddleware runs after TrimStringsMiddleware and before the middlewares of the route, so a forged request never reaches the logic of a module. The token is read from the csrf_token field or the X-CSRF-Token header; a failure is answered 403, negotiated as JSON for XHR because the Vue components read response.data.message.
Ships with enforce = false in config/csrf.php: a failure is only logged and the request is served, so a form that still misses the token surfaces in the log instead of in support. The flag goes away when the check is turned on.
Ships with enforce = false in config/csrf.php: a failure is only logged and the request is served, so a form that still misses the token surfaces in the log instead of in support. The flag goes away when the check is turned on.