Skip to content

Commit

Permalink
Pass metadata to request token store on get.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhanson committed Feb 11, 2016
1 parent eca7db5 commit aeb4b7a
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions lib/strategy.js
Expand Up @@ -143,7 +143,8 @@ OAuthStrategy.prototype.authenticate = function(req, options) {
// fetch profile information from the service provider, is sufficient to
// establish the identity of the user.
var oauthToken = req.query.oauth_token;
this._requestTokenStore.get(req, oauthToken, function(err, oauthTokenSecret) {

function loaded(err, oauthTokenSecret) {
if (err) { return self.error(err); }

// NOTE: The oauth_verifier parameter will be supplied in the query portion
Expand Down Expand Up @@ -190,7 +191,18 @@ OAuthStrategy.prototype.authenticate = function(req, options) {
});
});
});
});
}

try {
var arity = self._requestTokenStore.get.length;
if (arity == 4) {
this._requestTokenStore.get(req, oauthToken, meta, loaded);
} else { // arity == 3
this._requestTokenStore.get(req, oauthToken, loaded);
}
} catch (ex) {
return this.error(ex);
}
} else {
// In order to authenticate via OAuth, the application must obtain a request
// token from the service provider and redirect the user to the service
Expand Down

0 comments on commit aeb4b7a

Please sign in to comment.