Skip to content

Commit

Permalink
fix(app:api:user): Missing user response code
Browse files Browse the repository at this point in the history
Changes:
- Send `404` response code when a user cannot be found

Closes #438
  • Loading branch information
kingcody committed Aug 16, 2014
1 parent c9f80bc commit c176660
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/templates/server/api/user(auth)/user.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ exports.show = function (req, res, next) {

User.findById(userId, function (err, user) {
if (err) return next(err);
if (!user) return res.send(401);
if (!user) return res.send(404);
res.json(user.profile);
});
};
Expand Down Expand Up @@ -88,7 +88,7 @@ exports.me = function(req, res, next) {
_id: userId
}, '-salt -hashedPassword', function(err, user) { // don't ever give out the password or salt
if (err) return next(err);
if (!user) return res.json(401);
if (!user) return res.json(404);
res.json(user);
});
};
Expand Down

0 comments on commit c176660

Please sign in to comment.