diff --git a/index.js b/index.js index 438cee7..fec9feb 100644 --- a/index.js +++ b/index.js @@ -119,11 +119,11 @@ OAuth2Provider.prototype.oauth = function() { }); } else if(req.method == 'POST' && self.options.authorize_uri == uri) { - var client_id = req.query.client_id, - redirect_uri = req.query.redirect_uri, - response_type = req.query.response_type || 'code', - state = req.query.state, - x_user_id = req.query.x_user_id; + var client_id = (req.query.client_id || req.body.client_id), + redirect_uri = (req.query.redirect_uri || req.body.redirect_uri), + response_type = (req.query.response_type || req.body.response_type) || 'code', + state = (req.query.state || req.body.state), + x_user_id = (req.query.x_user_id || req.body.x_user_id); var url = redirect_uri;