Friday 24 April 2020

How to properly implment CSRF protection for a node and react setup?

I am having trouble with finding a way to properly implement CSRF protection. For node I have addedapp.use(csrf({ cookie: true, value: (req) => (req.cookies.csrfToken) })); and for react Im using axios to fetch data from server. How can I set header for CSRF for every type of request? and can I use an axios interceptor for setting headers to all requests or do I need manually set axios route in react app for CSRF?

Submitted April 24, 2020 at 03:11PM by silenf

No comments:

Post a Comment