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

Commit

Permalink
Fixing password headers
Browse files Browse the repository at this point in the history
  • Loading branch information
amoshaviv committed Aug 5, 2014
1 parent e56c76a commit 5087895
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions app/controllers/users/users.password.server.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,13 @@ exports.forgot = function(req, res, next) {
html: emailHTML
};
smtpTransport.sendMail(mailOptions, function(err) {
res.send({
message: 'An email has been sent to ' + user.email + ' with further instructions.'
});
done(err, 'done');
if (!err) {
res.send({
message: 'An email has been sent to ' + user.email + ' with further instructions.'
});
}

done(err);
});
}
], function(err) {
Expand Down Expand Up @@ -174,6 +177,7 @@ exports.reset = function(req, res, next) {
subject: 'Your password has been changed',
html: emailHTML
};

smtpTransport.sendMail(mailOptions, function(err) {
done(err, 'done');
});
Expand Down

0 comments on commit 5087895

Please sign in to comment.