Merge pull request #252 from haio/master

Fix bug in User#resetPassword
This commit is contained in:
Raymond Feng 2014-05-13 13:10:42 -07:00
commit 999ac64869
1 changed files with 3 additions and 2 deletions

View File

@ -379,7 +379,7 @@ User.resetPassword = function(options, cb) {
options = options || {}; options = options || {};
if(typeof options.email === 'string') { if(typeof options.email === 'string') {
UserModel.findOne({email: options.email}, function(err, user) { UserModel.findOne({ where: {email: options.email} }, function(err, user) {
if(err) { if(err) {
cb(err); cb(err);
} else if(user) { } else if(user) {
@ -392,7 +392,8 @@ User.resetPassword = function(options, cb) {
cb(); cb();
UserModel.emit('resetPasswordRequest', { UserModel.emit('resetPasswordRequest', {
email: options.email, email: options.email,
accessToken: accessToken accessToken: accessToken,
user: user
}); });
} }
}) })