Skip to content

Commit

Permalink
fix: errors thrown if no password sent in to profile edit route
Browse files Browse the repository at this point in the history
  • Loading branch information
julianlam committed Oct 8, 2020
1 parent 549ca11 commit 7757f96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/controllers/write/users.js
Expand Up @@ -29,7 +29,7 @@ Users.update = async (req, res) => {
const [isAdminOrGlobalMod, canEdit, passwordMatch] = await Promise.all([
user.isAdminOrGlobalMod(req.user.uid),
privileges.users.canEdit(req.user.uid, req.params.uid),
user.isPasswordCorrect(req.body.uid, req.body.password, req.ip),
req.body.password ? user.isPasswordCorrect(req.body.uid, req.body.password, req.ip) : false,
]);

// Changing own email/username requires password confirmation
Expand Down

0 comments on commit 7757f96

Please sign in to comment.