Do not run authentication if headers already sent

This commit is contained in:
D. Berge
2020-10-12 19:41:00 +02:00
parent 7201c29df5
commit 5594b6863c

View File

@@ -44,6 +44,12 @@ async function authorisedHost (req, res) {
async function auth (req, res, next) {
if (res.headersSent) {
// Nothing to do, this request must have been
// handled already by another middleware.
return;
}
// Check for a valid JWT (already decoded by a previous
// middleware).
if (req.user) {