profile updates must be POST

This commit is contained in:
Girish Ramakrishnan
2016-06-02 00:31:41 -07:00
parent 4fcc7fe99f
commit 60ce6b69ee
4 changed files with 20 additions and 20 deletions
+2 -2
View File
@@ -68,8 +68,8 @@ 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, 'API call requires the users old password.'));
if (typeof req.body.newPassword !== 'string') return next(new HttpError(400, 'API call requires the users new password.'));
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'));
if (req.user.tokenType !== tokendb.TYPE_USER) return next(new HttpError(403, 'Token type not allowed'));