From 116458671c60e57f5c345c1395f9890b837452b3 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Tue, 25 Mar 2014 14:39:51 +0000 Subject: [PATCH] callback is not defined, use next when there is an error in controller --- .../app/coffee/controllers/UserController.coffee | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/services/web/app/coffee/controllers/UserController.coffee b/services/web/app/coffee/controllers/UserController.coffee index a373e14043..dd066bfc4a 100644 --- a/services/web/app/coffee/controllers/UserController.coffee +++ b/services/web/app/coffee/controllers/UserController.coffee @@ -171,7 +171,7 @@ module.exports = metrics.inc "user.password-change" oldPass = req.body.currentPassword AuthenticationManager.authenticate _id: req.session.user._id, oldPass, (err, user)-> - return callback(err) if err? + return next(err) if err? if(user) logger.log user: req.session.user, "changing password" newPassword1 = req.body.newPassword1 @@ -197,23 +197,23 @@ module.exports = type:'error' text:'Your old password is wrong' - redirectUserToDropboxAuth: (req, res)-> + redirectUserToDropboxAuth: (req, res, next)-> user_id = req.session.user._id dropboxHandler.getDropboxRegisterUrl user_id, (err, url)-> - return callback(err) if err? + return next(err) if err? logger.log url:url, "redirecting user for dropbox auth" res.redirect url - completeDropboxRegistration: (req, res)-> + completeDropboxRegistration: (req, res, next)-> user_id = req.session.user._id dropboxHandler.completeRegistration user_id, (err, success)-> - return callback(err) if err? + return next(err) if err? res.redirect('/user/settings#dropboxSettings') - unlinkDropbox: (req, res)-> + unlinkDropbox: (req, res, next)-> user_id = req.session.user._id dropboxHandler.unlinkAccount user_id, (err, success)-> - return callback(err) if err? + return next(err) if err? res.redirect('/user/settings#dropboxSettings') deleteUser: (req, res)->