Skip to content Skip to sidebar Skip to footer

Express Unable To Save Headers After Page Reload

I'm using this method to set authorization header after success login router.post('/attempt', function (req, res, next) { ..... ..... req.headers.authorization = 'JWT ' + token; co

Solution 1:

If you want to send headers to the browser then use res.set(); like

res.set('authorization', 'JWT ' + token);

but if you want to get to a header from request then use req.headers object like

var token =  req.headers.authorization;

Post a Comment for "Express Unable To Save Headers After Page Reload"