Skip to content

Commit c176660

Browse files
committed
fix(app:api:user): Missing user response code
Changes: - Send `404` response code when a user cannot be found Closes #438
1 parent c9f80bc commit c176660

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/templates/server/api/user(auth)/user.controller.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ exports.show = function (req, res, next) {
4242

4343
User.findById(userId, function (err, user) {
4444
if (err) return next(err);
45-
if (!user) return res.send(401);
45+
if (!user) return res.send(404);
4646
res.json(user.profile);
4747
});
4848
};
@@ -88,7 +88,7 @@ exports.me = function(req, res, next) {
8888
_id: userId
8989
}, '-salt -hashedPassword', function(err, user) { // don't ever give out the password or salt
9090
if (err) return next(err);
91-
if (!user) return res.json(401);
91+
if (!user) return res.json(404);
9292
res.json(user);
9393
});
9494
};

0 commit comments

Comments
 (0)