You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You could register a new error-handling middleware that does what you want. Something like this:
// ./lib/logCsrf.jsmodule.exports=functionlogCsrfFailuresGenerator(){returnfunctionlogCsrfFailures(err,req,res,next){if(res.statusCode===403&&/csrf/i.test(err.message)){// ... csrf failure -- do your logging here ...}next(err);// don't forget to proceed with the continuation!};}
Then, in your config:
{// ..."middleware": {// ..."logCsrfFailures": {"enabled": true,"priority": 139,// just make sure it's before any error handlers that render!"module": "path:./lib/logCsrf"}}}
Is there a way to hook into to when a CSRF returns 404? I'd like to check in on the IP of the originating server to see if I can just block them.
The text was updated successfully, but these errors were encountered: