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
Post a Comment