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
_http_outgoing.js:359
throw new Error('Can\'t set headers after they are sent.');
^
Error: Can't set headers after they are sent.
at ServerResponse.setHeader (_http_outgoing.js:359:11)
at ServerResponse.header (/Users/opeaucelle/Sites/test/es6-express-mongoose-passport-rest-api/node_modules/express/lib/response.js:719:10)
at ServerResponse.send (/Users/opeaucelle/Sites/test/es6-express-mongoose-passport-rest-api/node_modules/express/lib/response.js:164:12)
at ServerResponse.json (/Users/opeaucelle/Sites/test/es6-express-mongoose-passport-rest-api/node_modules/express/lib/response.js:250:15)
at /Users/opeaucelle/Sites/test/es6-express-mongoose-passport-rest-api/src/server/controllers/auth.controller.js:31:11
at /Users/opeaucelle/Sites/test/es6-express-mongoose-passport-rest-api/node_modules/passport/lib/middleware/authenticate.js:236:29
at /Users/opeaucelle/Sites/test/es6-express-mongoose-passport-rest-api/node_modules/passport/lib/http/request.js:51:48
at pass (/Users/opeaucelle/Sites/test/es6-express-mongoose-passport-rest-api/node_modules/passport/lib/authenticator.js:287:14)
at Authenticator.serializeUser (/Users/opeaucelle/Sites/test/es6-express-mongoose-passport-rest-api/node_modules/passport/lib/authenticator.js:289:5)
at IncomingMessage.req.login.req.logIn (/Users/opeaucelle/Sites/test/es6-express-mongoose-passport-rest-api/node_modules/passport/lib/http/request.js:50:29)
at Strategy.strategy.success (/Users/opeaucelle/Sites/test/es6-express-mongoose-passport-rest-api/node_modules/passport/lib/middleware/authenticate.js:235:13)
at verified (/Users/opeaucelle/Sites/test/es6-express-mongoose-passport-rest-api/node_modules/passport-local/lib/strategy.js:83:10)
at InternalFieldObject.ondone (/Users/opeaucelle/Sites/test/es6-express-mongoose-passport-rest-api/node_modules/passport-local-mongoose/index.js:152:16)
[nodemon] app crashed - waiting for file changes before starting...
The text was updated successfully, but these errors were encountered:
You are sending two response to client. Send only one response to client. If error happens, send error response and if there is success then send success response.
STR:
POST: http://localhost:4040/auth/register
payload:
then do the same a second time
Observe log in terminal:
The text was updated successfully, but these errors were encountered: