Skip to content

Node.js based forum software built for the modern web

fixed email exists error... weird.

Julian Lam3da96faa1239
diff --git a/public/src/forum/register.js b/public/src/forum/register.js
index b7987055e0..3e839c6f58 100644
--- a/public/src/forum/register.js
+++ b/public/src/forum/register.js
@@ -44,8 +44,8 @@ define(function() {
} else {
socket.emit('api:user.emailExists', {
email: emailEl.val()
- }, function(data) {
- if (data.exists === true) {
+ }, function(exists) {
+ if (exists === true) {
showError(email_notify, 'Email address already taken!');
} else {
showSuccess(email_notify, successIcon);
diff --git a/src/user.js b/src/user.js
index f3c737fd62..4fd5119507 100644
--- a/src/user.js
+++ b/src/user.js
@@ -930,14 +930,7 @@ var bcrypt = require('bcrypt'),
},
exists: function(socket, email, callback) {
User.getUidByEmail(email, function(err, exists) {
- exists = !! exists;
- if (typeof callback !== 'function') {
- socket.emit('user.email.exists', {
- exists: exists
- });
- } else {
- callback(exists);
- }
+ callback(!!exists);
});
},
confirm: function(code, callback) {