Open oslo10e opened 6 years ago
it could be fixed by adding return
in auth.controller.js
if (err) {
const error = new APIError('Authentication error', httpStatus.UNAUTHORIZED)
next(error)
return
}
Hi @oslo10e, thanks for reporting! Will take a look in the morning and see whats up, will post PR shortly :)
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: