Answer the question
In order to leave comments, you need to log in
Can't set headers after they are sent?
Good day!
there is a piece of code
app.post 'auth', (req, res, next) ->
if app.locals.auth
res.redirect '/'
do next
Answer the question
In order to leave comments, you need to log in
If you do a redirect, then next is no longer needed. Middleware chains are worth it, that you need to transfer further only if the request has not yet been processed.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question