From ebcf1c29503277663a34518029f343b8d5ce7ad4 Mon Sep 17 00:00:00 2001 From: ciaranj Date: Sun, 18 Jul 2010 23:43:39 +0100 Subject: [PATCH] Weird, found a missing argument that I could swear I'd put in previously?!!? --- Readme.md | 2 +- lib/oauth.js | 11 +++++++++-- package.json | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Readme.md b/Readme.md index 96da511..32199cc 100644 --- a/Readme.md +++ b/Readme.md @@ -9,7 +9,7 @@ at express-auth (http://github.com/ciaranj/express-auth) Change History ============== - +* 0.7.6 - Added in oauth_verifier property to getAccessToken required for 1.0A * 0.7.5 - Added in a main.js to simplify the require'ing of OAuth * 0.7.4 - Minor change to add an error listener to the OAuth client (thanks troyk) * 0.7.3 - OAuth 2 now sends a Content-Length Http header to keep nginx happy :) diff --git a/lib/oauth.js b/lib/oauth.js index 224f94d..562e435 100644 --- a/lib/oauth.js +++ b/lib/oauth.js @@ -233,8 +233,15 @@ exports.OAuth.prototype._performSecureRequest= function( oauth_token, oauth_toke request.end(); } -exports.OAuth.prototype.getOauthAccessToken= function(oauth_token, oauth_token_secret, callback) { - this._performSecureRequest( oauth_token, oauth_token_secret, "GET", this._accessUrl, null, function(error, data, response) { +exports.OAuth.prototype.getOauthAccessToken= function(oauth_token, oauth_token_secret, oauth_verifier, callback) { + var extraParams= {}; + if( typeof oauth_verifier == "function" ) { + callback= oauth_verifier; + } else { + extraParams.oauth_verifier= oauth_verifier; + } + + this._performSecureRequest( oauth_token, oauth_token_secret, "GET", this._accessUrl, extraParams, function(error, data, response) { if( error ) callback(error); else { var results= querystring.parse( data ); diff --git a/package.json b/package.json index 8bcd76d..3b8db58 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { "name" : "oauth" -, "version" : "0.7.5" +, "version" : "0.7.6" , "directories" : { "lib" : "./lib" } , "main" : "main.js" , "author" : "Ciaran Jessup"