fixed oauth problems with POST requests fixes #10

This commit is contained in:
javi santana 2011-12-26 12:51:15 +01:00
parent 4a9e00e476
commit 6c003626b4

View File

@ -16,7 +16,7 @@ var oAuth = function(){
// * in GET request
// * in header
me.parseTokens = function(req){
var query_oauth = _.clone(req.query);
var query_oauth = _.clone(req.method == "POST" ? req.body: req.query);
var header_oauth = {};
var oauth_variables = ['oauth_body_hash',
'oauth_consumer_key',
@ -64,6 +64,7 @@ var oAuth = function(){
// do new fancy get User ID
me.verifyRequest = function(req, callback){
var that = this;
//TODO: review this
var http = arguments['2'];
var passed_tokens;
var ohash;
@ -97,6 +98,10 @@ var oAuth = function(){
var base64;
var joined = {};
// remove oauth_signature from body
if(req.body) {
delete req.body['oauth_signature'];
}
_.extend(joined, req.body ? req.body : null);
_.extend(joined, passed_tokens);
_.extend(joined, req.query);