mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-08-05 00:00:57 +02:00
Merge pull request #1236 from lirantal/bugfix/ignored_errors_on_controller
fix(users) error objects were not handled
This commit is contained in:
@@ -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'
|
||||
});
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user