Return auth error on failed user data request

This commit is contained in:
Chris Blanchard 2015-08-18 11:44:49 +01:00
parent e8de9f2498
commit 523bf2a099

View file

@ -48,7 +48,7 @@ module.exports = io => {
}, (error, response, body) => {
if (error || response.statusCode !== 200) {
winston.error(error);
return next(error)
return next(new Error("Authentication Failed"))
};
socket._user = new User(body);
winston.info("Logged in:", body.username, body.id);