From 978bc574211df6ea091a283ce9465e58ab386140 Mon Sep 17 00:00:00 2001 From: haio Date: Sat, 10 May 2014 15:43:01 +0800 Subject: [PATCH] Fix bug in User#resetPassword --- lib/models/user.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 }); } })