index : matrix-js-sdk

My fork of matrix-js-sdk

diff options
context:
space:
mode:
authorMichael Telatynski <[email protected]>2020-06-12 22:33:26 +0100
committerGitHub <[email protected]>2020-06-12 22:33:26 +0100
commit505915528f4b0c2e0a56809675529cd8d418508f (patch)
tree1c762a4d17b2fbb7b727d71b4f1b763548818776
parent1da959ab022c59645199ed96e449d0102a21c9f2 (diff)
parentace8a787b4ff3486cc2a7d4dbacc73aaa440e7b8 (diff)
downloadmatrix-js-sdk-505915528f4b0c2e0a56809675529cd8d418508f.tar.gz
Merge pull request #1403 from matrix-org/t3chguy/attemptAuth-existing-session
Use existing session id for fetching flows as to not get a new session
-rw-r--r--src/interactive-auth.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/interactive-auth.js b/src/interactive-auth.js
index ad47701e..edf5a429 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 {