Skip to content

Commit

Permalink
Merge pull request #22 from mjsalinger/fix-response-handler
Browse files Browse the repository at this point in the history
Fix response handler
  • Loading branch information
mjsalinger authored Nov 11, 2016
2 parents ade1ca4 + 780da2d commit b47f246
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,17 @@ ExpressOAuthServer.prototype.token = function(options) {
/**
* Handle response.
*/

var handleResponse = function(req, res, response) {
res.set(response.headers);
res.status(response.status).send(response.body);

if (response.status === 302) {
var location = response.headers.location;
delete response.headers.location;
res.set(response.headers);
res.redirect(location);
} else {
res.set(response.headers);
res.status(response.status).send(response.body);
}
};

/**
Expand Down

0 comments on commit b47f246

Please sign in to comment.