Skip to content

Commit

Permalink
Add select method to avoid sending sensitive data in response for ava…
Browse files Browse the repository at this point in the history
…tar update api
  • Loading branch information
wajeshubham committed Jul 16, 2023
1 parent 10ebd35 commit b4cae38
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/controllers/apps/auth/user.controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,8 @@ const updateUserAvatar = asyncHandler(async (req, res) => {
},
},
{ new: true }
).select(
"-password -refreshToken -emailVerificationToken -emailVerificationExpiry"
);

// remove the old avatar
Expand Down

0 comments on commit b4cae38

Please sign in to comment.