Skip to content

Commit

Permalink
Merge pull request bnoguchi#380 from kyriesent/patch-1
Browse files Browse the repository at this point in the history
Fix for Issue 250: Dynamic scoping caching issue
  • Loading branch information
bnoguchi committed Mar 7, 2013
2 parents 6d335c5 + 445819b commit be92f60
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions lib/modules/oauth2.js
Expand Up @@ -108,16 +108,17 @@ everyModule.submodule('oauth2')
// function () {
// return this._scope && this.scope();
// }
additionalParams[k] = // cache the function call
param = param.call(this);
}
if ('function' === typeof param) {
// this.scope() itself could be a function
// to allow for dynamic scope determination - e.g.,
// function (req, res) {
// return req.session.onboardingPhase; // => "email"
// }
param = param.call(this, req, res);
param = param.call(this);
if ('function' === typeof param) {
// this.scope() itself could be a function
// to allow for dynamic scope determination - e.g.,
// function (req, res) {
// return req.session.onboardingPhase; // => "email"
// }
param = param.call(this, req, res);
} else {
additionalParams[k] = param // cache the function call if not dynamically generated
}
}
params[k] = param;
}
Expand Down

0 comments on commit be92f60

Please sign in to comment.