Skip to content

Commit

Permalink
removes password and salt from isAuthenticated response
Browse files Browse the repository at this point in the history
  • Loading branch information
davelandry committed Sep 30, 2021
1 parent 76c7574 commit b9bdee1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/core/src/auth/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ module.exports = function(app) {
})
);

app.get("/auth/isAuthenticated", isAuthenticated, (req, res) => res.json({...req.user, authenticated: true}));
app.get("/auth/isAuthenticated", isAuthenticated, (req, res) => {
const sanitizedUser = {...req.user, authenticated: true};
delete sanitizedUser.password;
delete sanitizedUser.salt;
return res.json(sanitizedUser);
});

app.get("/auth/logout", (req, res) => {
req.logout();
Expand Down

0 comments on commit b9bdee1

Please sign in to comment.