From bbd75d63ebd6f4bf7b71fc319b069ef5760a05af Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 16 Mar 2017 15:41:33 -0600 Subject: [PATCH] resolve providerUri on refreshToken --- oauth3.core.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/oauth3.core.js b/oauth3.core.js index dd3fea9..e609400 100644 --- a/oauth3.core.js +++ b/oauth3.core.js @@ -587,6 +587,11 @@ return OAUTH3.hooks.session.check(preq, opts).then(fetch); } , _requestHelper: function (preq, opts) { + /* + if (opts && opts.directives) { + preq.url = OAUTH3.url.resolve(opts.directives.issuer, preq.url); + } + */ return OAUTH3._browser.request(preq, opts); } , implicitGrant: function(directives, opts) { @@ -666,7 +671,8 @@ return OAUTH3.discover(providerUri, opts).then(function (directive) { var prequest = OAUTH3.urls.refreshToken(directive, opts); - return OAUTH3.request(prequest).then(function (req) { + prequest.url = OAUTH3.url.resolve(providerUri/*directives.issuer*/, prequest.url); + return OAUTH3.request(prequest/*, { directives: directive }*/).then(function (req) { var data = req.data; data.provider_uri = providerUri; if (data.error) { @@ -1071,6 +1077,7 @@ } // TODO maybe use a baseUrl from the directives file? preq.url = OAUTH3.url.resolve(this._providerUri, preq.url); + return OAUTH3.request(preq, opts); } , logout: function (opts) {