Skip to content

Commit

Permalink
rmv password from login res
Browse files Browse the repository at this point in the history
  • Loading branch information
Aditya-Thakur committed Sep 12, 2021
1 parent 6648a2c commit 8b4ba11
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion controllers/userController.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ function fetchUser(req, res) {
if(!err){
bcrypt.comparePassword(req.body.password, docs.password, (err, cmp) => {
if(cmp) {
res.json(docs);
const userRes = docs;
delete userRes.password;
res.json(userRes);
} else {
console.log('Wrong Password: ' + err);
res.json({
Expand Down

1 comment on commit 8b4ba11

@vercel
Copy link

@vercel vercel bot commented on 8b4ba11 Sep 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.