You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am running your code on cloud foundry. Whenever I try to enter the secure page without being authenticated, I get the following error
ERR Error: Can't set headers after they are sent.
ERR at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:335:11)
ERR at ServerResponse.header (/home/vcap/app/node_modules/express/lib/response.js:718:10)
ERR at ServerResponse.send (/home/vcap/app/node_modules/express/lib/response.js:163:12)
ERR at /home/vcap/app/routes/secure.js:12:30
Line causing the problem is:
next(res.sendStatus(403).send('Forbidden'));
It seems to be because the header has already been sent, and you are trying to set the status code
The text was updated successfully, but these errors were encountered:
Hi,
I am running your code on cloud foundry. Whenever I try to enter the secure page without being authenticated, I get the following error
ERR Error: Can't set headers after they are sent.
ERR at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:335:11)
ERR at ServerResponse.header (/home/vcap/app/node_modules/express/lib/response.js:718:10)
ERR at ServerResponse.send (/home/vcap/app/node_modules/express/lib/response.js:163:12)
ERR at /home/vcap/app/routes/secure.js:12:30
Line causing the problem is:
next(res.sendStatus(403).send('Forbidden'));
It seems to be because the header has already been sent, and you are trying to set the status code
The text was updated successfully, but these errors were encountered: