do not check for password in profile route
This is already checked by the verifyPassword middleware based on the token type. When using dev tokens, this check barfs for lack of password field even when none is required.
This commit is contained in:
@@ -57,7 +57,6 @@ function changePassword(req, res, next) {
|
||||
assert.strictEqual(typeof req.body, 'object');
|
||||
assert.strictEqual(typeof req.user, 'object');
|
||||
|
||||
if (typeof req.body.password !== 'string') return next(new HttpError(400, 'password must be set to old password'));
|
||||
if (typeof req.body.newPassword !== 'string') return next(new HttpError(400, 'newPassword must be a string'));
|
||||
|
||||
user.setPassword(req.user.id, req.body.newPassword, function (error) {
|
||||
|
||||
Reference in New Issue
Block a user