Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Commit

Permalink
fix request so that only get and post requests are handled
Browse files Browse the repository at this point in the history
  • Loading branch information
typerandom committed Mar 16, 2016
1 parent 69edbd4 commit ef8822a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/controllers/change-password.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ module.exports = function (req, res, next) {

helpers.handleAcceptRequest(req, res, {
'application/json': function () {
if (req.method !== 'GET' && req.method !== 'POST') {
return next();
}

application.verifyPasswordResetToken(sptoken, function (err, result) {
if (err) {
logger.info('A user attempted to reset their password with a token, but that token verification failed.');
return helpers.writeJsonError(res, err);
}

if (req.method !== 'POST') {
return next();
}

result.password = req.body.password;

return result.save(function (err) {
Expand Down

0 comments on commit ef8822a

Please sign in to comment.