Ad

How To Disable Csrf For A Specific Route In Sails V1

- 1 answer

In previous versions it was possible to disable csrf for specific routes using:

module.exports.csrf = {
  "routesDisabled": "/webhooks/testhook,/webhooks/anotherhook"
}

Is there a new way to do that or should I make a small hack in the controller for auto-generate a csrf?

Ad

Answer

Ok I figured it out, now it is done in /routes.js like this:

'PUT   /webhooks/testhook':                        { action: 'entrance/testhook', csrf: false},
Ad
source: stackoverflow.com
Ad