From 3da96faa1239703d5999faf75524d3b3a9180216 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Sat, 11 Jan 2014 22:14:20 -0500 Subject: [PATCH] fixed email exists error... weird. --- public/src/forum/register.js | 4 ++-- src/user.js | 9 +-------- 2 files changed, 3 insertions(+), 10 deletions(-) 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) {