Skip to content

Commit d70a0ae

Browse files
committed
re-implementing password reset
1 parent b5dd5d1 commit d70a0ae

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mongo.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ module.exports = {
2828
updateUserResetHash: updateUserResetHash
2929
};
3030

31-
function updateUserPasswordForgot(userId, hash, newPassword) {
31+
function updateUserPasswordForgot(email, hash, newPassword) {
3232
return User.findOneAndUpdate({
33-
_id: userId,
33+
email: email,
3434
passwordResetHash: hash
3535
}, {
3636
passwordResetHash: '',
@@ -46,7 +46,7 @@ function updateUserPasswordForgot(userId, hash, newPassword) {
4646
winston.error('', {
4747
error: err.message,
4848
stack: err.stack,
49-
userId: userId
49+
email: email
5050
});
5151

5252
throw err;

0 commit comments

Comments
 (0)