From 0024edcb7f2722352f1cab965789595db901165e Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 12 Jun 2020 19:50:38 +0100 Subject: [PATCH 1/3] Use existing session id for fetching flows as to not get a new session id --- src/interactive-auth.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/interactive-auth.js b/src/interactive-auth.js index ad47701e1..edf5a4290 100644 --- a/src/interactive-auth.js +++ b/src/interactive-auth.js @@ -148,8 +148,14 @@ InteractiveAuth.prototype = { // if we have no flows, try a request to acquire the flows if (!hasFlows) { if (this._busyChangedCallback) this._busyChangedCallback(true); - // Do a fresh request as we're just acquiring flows. - this._doRequest(null).finally(() => { + // use the existing sessionid, if one is present. + let auth = null; + if (this._data.session) { + auth = { + session: this._data.session, + }; + } + this._doRequest(auth).finally(() => { if (this._busyChangedCallback) this._busyChangedCallback(false); }); } else { From 590f7786ebc194adc27df9ee507a29f2aa14eb57 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 12 Jun 2020 20:00:08 +0100 Subject: [PATCH 2/3] clean up --- src/interactive-auth.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/interactive-auth.js b/src/interactive-auth.js index edf5a4290..b7e99b3d9 100644 --- a/src/interactive-auth.js +++ b/src/interactive-auth.js @@ -148,14 +148,7 @@ InteractiveAuth.prototype = { // if we have no flows, try a request to acquire the flows if (!hasFlows) { if (this._busyChangedCallback) this._busyChangedCallback(true); - // use the existing sessionid, if one is present. - let auth = null; - if (this._data.session) { - auth = { - session: this._data.session, - }; - } - this._doRequest(auth).finally(() => { + this._doRequest(this._data || null).finally(() => { if (this._busyChangedCallback) this._busyChangedCallback(false); }); } else { From cb5771742471339a0bbd9d332f6399989c835897 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 12 Jun 2020 20:06:58 +0100 Subject: [PATCH 3/3] undo that because `{}` sux --- src/interactive-auth.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/interactive-auth.js b/src/interactive-auth.js index b7e99b3d9..edf5a4290 100644 --- a/src/interactive-auth.js +++ b/src/interactive-auth.js @@ -148,7 +148,14 @@ InteractiveAuth.prototype = { // if we have no flows, try a request to acquire the flows if (!hasFlows) { if (this._busyChangedCallback) this._busyChangedCallback(true); - this._doRequest(this._data || null).finally(() => { + // use the existing sessionid, if one is present. + let auth = null; + if (this._data.session) { + auth = { + session: this._data.session, + }; + } + this._doRequest(auth).finally(() => { if (this._busyChangedCallback) this._busyChangedCallback(false); }); } else {