diff --git a/lib/models/user.js b/lib/models/user.js index 374fe7c4..73a18d39 100644 --- a/lib/models/user.js +++ b/lib/models/user.js @@ -379,7 +379,7 @@ User.resetPassword = function(options, cb) { options = options || {}; if(typeof options.email === 'string') { - UserModel.findOne({email: options.email}, function(err, user) { + UserModel.findOne({ where: {email: options.email} }, function(err, user) { if(err) { cb(err); } else if(user) { @@ -392,7 +392,8 @@ User.resetPassword = function(options, cb) { cb(); UserModel.emit('resetPasswordRequest', { email: options.email, - accessToken: accessToken + accessToken: accessToken, + user: user }); } })