fixed email exists error... weird.

v1.18.x
Julian Lam 11 years ago
parent 98e4257939
commit 3da96faa12

@ -44,8 +44,8 @@ define(function() {
} else { } else {
socket.emit('api:user.emailExists', { socket.emit('api:user.emailExists', {
email: emailEl.val() email: emailEl.val()
}, function(data) { }, function(exists) {
if (data.exists === true) { if (exists === true) {
showError(email_notify, 'Email address already taken!'); showError(email_notify, 'Email address already taken!');
} else { } else {
showSuccess(email_notify, successIcon); showSuccess(email_notify, successIcon);

@ -930,14 +930,7 @@ var bcrypt = require('bcrypt'),
}, },
exists: function(socket, email, callback) { exists: function(socket, email, callback) {
User.getUidByEmail(email, function(err, exists) { User.getUidByEmail(email, function(err, exists) {
exists = !! exists; callback(!!exists);
if (typeof callback !== 'function') {
socket.emit('user.email.exists', {
exists: exists
});
} else {
callback(exists);
}
}); });
}, },
confirm: function(code, callback) { confirm: function(code, callback) {

Loading…
Cancel
Save