Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
fix(users): error objects were not handled
Browse files Browse the repository at this point in the history
  • Loading branch information
lirantal committed Feb 27, 2016
1 parent 5105eb1 commit 8e24954
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ exports.forgot = function (req, res, next) {
User.findOne({
username: req.body.username.toLowerCase()
}, '-salt -password', function (err, user) {
if (!user) {
if (err || !user) {
return res.status(400).send({
message: 'No account with that username has been found'
});
Expand Down Expand Up @@ -108,7 +108,7 @@ exports.validateResetToken = function (req, res) {
$gt: Date.now()
}
}, function (err, user) {
if (!user) {
if (err || !user) {
return res.redirect('/password/reset/invalid');
}

Expand Down

0 comments on commit 8e24954

Please sign in to comment.