node.js - Invalid CSRF Token via Postman -


i using csrf protection in mean-stack application csurf node.js module.

as long send post requests angular frontend web service, works fine. if try make post request via postman, i'll face:

"forbiddenerror: invalid csrf token"

according first answer how send spring csrf token postman rest client? token out of cookie login request , set every post request. requests working fine.

i configured follows:

app.use(csrf({cookie: {path: '/', httponly: true}})); app.use(function(req, res, next) {     let token = req.csrftoken();     res.cookie('xsrf-token', token);     res.locals.csrftoken = token;     next(); }); 

best regards,

tobias


Comments

Popular posts from this blog

sql - can we replace full join with union of left and right join? why not? -

javascript - Parallax scrolling and fixed footer code causing width issues -

iOS: Performance of reloading UIImage(name:...) -