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:
Girish Ramakrishnan
2016-06-02 14:25:59 -07:00
parent 65261dc4d5
commit 462440bb30

View File

@@ -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) {