Error: Can't Set Headers After They Are Sent
I'm trying to do a login function but the Error: Can't set headers after they are sent is keep showing up in my terminal, based on my understanding this error is causing by res but
Solution 1:
It looks like the callback passed to validateLogin
is called twice:
- once from
validateUserDoc
; - once from the
process.nextTick
callback (that part seems to be some left-over code);
Post a Comment for "Error: Can't Set Headers After They Are Sent"