Skip to content

Commit

Permalink
Fix user update security vulnerability (#615)
Browse files Browse the repository at this point in the history
  • Loading branch information
OmTheTurtle authored Apr 9, 2021
1 parent 06847d8 commit b2b1719
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/users/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ export const updateRole = asyncWrapper(async (req: Request, res: Response, next:

export const updateUser = asyncWrapper(async (req: Request, res: Response, next: NextFunction) => {
const id = (req.user as User).id
req.user = await User.query().patchAndFetchById(id, { ...req.body })
const { floor } = req.body
req.user = await User.query().patchAndFetchById(id, { floor })

next()
})
Expand Down

0 comments on commit b2b1719

Please sign in to comment.