Sailsjs using cluster mode pm2 and CSRF

I am running sailsjs app with pm2

and its cluster mode.

Now the problem is that since I am making cross-domain requests with CSRF validation, only one of the clusters has correct access, the others are giving me a CSMF mismatch error.

How do you use pm2 with CSRF?

+3
csrf sails.js pm2


source to share


1 answer


sails.js has built-in support for using Redis or MongoDB to share session state across a cluster, for example with the .io module, Heroku, or a custom cluster using pm2. You can set config values ​​for this in config/session.js

.

Cm:



  • setting up shared redis session storage
  • config/session.js

    link
  • config/csrf.js

    link
+1


source to share







All Articles
Loading...
X
Show
Funny
Dev
Pics