From 967ab7fe0a81385531254bb8d204294877eb67f4 Mon Sep 17 00:00:00 2001 From: Sahat Yalkabov Date: Thu, 30 Jan 2014 17:29:06 -0500 Subject: [PATCH] Updating email on profile page will correctly update it in the databse. Fixes issue #25 --- controllers/user.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/controllers/user.js b/controllers/user.js index 6e5674a6360..8ec8edbbceb 100644 --- a/controllers/user.js +++ b/controllers/user.js @@ -120,9 +120,8 @@ exports.getAccount = function(req, res) { exports.postUpdateProfile = function(req, res, next) { User.findById(req.user.id, function(err, user) { if (err) return next(err); - + user.email = req.body.email || ''; user.profile.name = req.body.name || ''; - user.profile.email = req.body.email || ''; user.profile.gender = req.body.gender || ''; user.profile.location = req.body.location || ''; user.profile.website = req.body.website || '';