diff --git a/public/src/forum/register.js b/public/src/forum/register.js index 58f340b54c..aa8fc66b59 100644 --- a/public/src/forum/register.js +++ b/public/src/forum/register.js @@ -44,7 +44,11 @@ define(function() { } else { socket.emit('user.emailExists', { email: emailEl.val() - }, function(exists) { + }, function(err, exists) { + if(err) { + return app.alertError(err.message); + } + if (exists) { showError(email_notify, 'Email address already taken!'); } else { diff --git a/src/socket.io/admin.js b/src/socket.io/admin.js index 0a6523fcb4..1fc9e91fac 100644 --- a/src/socket.io/admin.js +++ b/src/socket.io/admin.js @@ -15,6 +15,7 @@ var groups = require('../groups'), async = require('async'), winston = require('winston'), + index = require('./index'), SocketAdmin = {}; @@ -252,7 +253,7 @@ SocketAdmin.config.set = function(socket, data, callback) { }); } - logger.monitorConfig({io: socket.server}, data); + logger.monitorConfig({io: index.server}, data); }); }; diff --git a/src/user.js b/src/user.js index 8c12611149..da0257b870 100644 --- a/src/user.js +++ b/src/user.js @@ -933,7 +933,7 @@ var bcrypt = require('bcrypt'), }, exists: function(email, callback) { User.getUidByEmail(email, function(err, exists) { - callback(!!exists); + callback(err, !!exists); }); }, confirm: function(code, callback) {