fixed `this` scoping problem introduced with `_getCached` fix

This commit is contained in:
tigerbot 2017-11-13 13:56:58 -07:00
parent c77d280b00
commit 2438081487
1 changed files with 9 additions and 7 deletions

View File

@ -1433,23 +1433,25 @@
});
}
, logout: function (opts) {
this._session = false;
var me = this;
me._session = false;
opts = opts || {};
return OAUTH3.hooks.session.get(this._identityProviderUri).then(function (session) {
opts.client_uri = this._clientUri;
opts.client_id = this._clientUri;
return OAUTH3.hooks.session.get(me._identityProviderUri).then(function (session) {
opts.client_uri = me._clientUri;
opts.client_id = me._clientUri;
opts.session = session;
return OAUTH3.logout(this._identityProviderUri, opts);
return OAUTH3.logout(me._identityProviderUri, opts);
});
}
, api: function (api, opts) {
var me = this;
opts = opts || {};
return OAUTH3.hooks.session.get(this._identityProviderUri).then(function (session) {
return OAUTH3.hooks.session.get(me._identityProviderUri).then(function (session) {
opts.api = api;
opts.session = session;
return OAUTH3.api(this._resourceProviderDirectives.api, opts);
return OAUTH3.api(me._resourceProviderDirectives.api, opts);
});
}
, pkg: function (pkgname) {