Skip to content

Commit b7d035e

Browse files
author
App Generator
committed
Update users.js
1 parent c580aae commit b7d035e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/routes/users.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,12 @@ router.post('/login', (req, res) => {
8787
const token = jwt.sign(user, config.secret, {
8888
expiresIn: 86400, // 1 week
8989
});
90-
// Don't include the password in the returned user object
90+
9191
const query = { userId: user._id, token: token };
9292
ActiveSession.create(query, function(err, cd) {
93+
94+
// Delete the password (hash)
9395
user.password = null;
94-
user.__v = null;
9596
return res.json({
9697
success: true,
9798
token: token,

0 commit comments

Comments
 (0)