keep package vars even when then instance is changed

This commit is contained in:
aj 2017-08-23 16:16:18 +00:00
parent 5f68ea19e2
commit bf71399d12
1 changed files with 4 additions and 2 deletions

View File

@ -1274,6 +1274,8 @@
} }
, pkg: function (pkgname) { , pkg: function (pkgname) {
var me = this; var me = this;
var issuer = me._identityProviderUri;
var audience = me._resourceProviderDirectives.api;
var pkg; var pkg;
var result = {}; var result = {};
@ -1286,8 +1288,8 @@
Object.keys(pkg).forEach(function (key) { Object.keys(pkg).forEach(function (key) {
result[key] = function (opts) { result[key] = function (opts) {
opts = opts || {}; opts = opts || {};
opts.session = OAUTH3.hooks.session._getCached(me._identityProviderUri); opts.session = OAUTH3.hooks.session._getCached(issuer);
opts.audience = me._resourceProviderDirectives.api; opts.audience = audience;
return pkg[key](opts); return pkg[key](opts);
}; };
}); });