Skip to content

Commit e9a6500

Browse files
author
Mahmoud Ben Hassine
committed
remove password from user's rest api response
1 parent ca25506 commit e9a6500

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

routes/api.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ router.get('/user/:name', function(req, res) {
2727
if (user == null){
2828
res.status(404).end();
2929
} else {
30-
res.send(user);
30+
res.send({
31+
id: user._id,
32+
name: user.name,
33+
email: user.email,
34+
lastConnection: user.lastConnection
35+
});
3136
}
3237
});
3338
});

0 commit comments

Comments
 (0)