Improved getOAuthAccessToken to accept extra parameters #167

Open
igoramadas opened this Issue Dec 27, 2013 · 0 comments

Comments

Projects
None yet
1 participant

Hi there,

some OAuth implementations require us to send a few more parameters when getting the access token (for example the Withings API). So I would suggest updating the getOAuthAccessToken to accept extra parameters instead of only the verifier. The following code is backwards-compatible, shouldn't break current code and it's a bit more flexible:

Around line 431, renamed third argument to extraParams and updated the conditions:

exports.OAuth.prototype.getOAuthAccessToken= function(oauth_token, oauth_token_secret, extraParams, callback) {
if( typeof extraParams == "function" ) {
callback= extraParams;
extraParams = {};
} else if (typeof extraParams == "string") {
extraParams.oauth_verifier = extraParams;
}

Hope you can update it soon :-) Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment