1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

Request fresh flows on the initial registration request

This commit is contained in:
Travis Ralston
2020-05-27 13:16:10 -06:00
parent 8f72197817
commit f0fa249d36
2 changed files with 8 additions and 6 deletions

View File

@@ -143,11 +143,13 @@ InteractiveAuth.prototype = {
this._resolveFunc = resolve;
this._rejectFunc = reject;
// if we have no flows, try a request (we'll have
// just a session ID in _data if resuming)
if (this._data && !this._data.flows) {
const hasFlows = this._data && this._data.flows;
// if we have no flows, try a request to acquire the flows
if (!hasFlows) {
if (this._busyChangedCallback) this._busyChangedCallback(true);
this._doRequest(this._data).finally(() => {
// Do a fresh request as we're just acquiring flows.
this._doRequest(null).finally(() => {
if (this._busyChangedCallback) this._busyChangedCallback(false);
});
} else {
@@ -264,8 +266,7 @@ InteractiveAuth.prototype = {
}
}
// use the sessionid from the last request.
// but keep the null in authData if this is the first stage.
// use the sessionid from the last request, if one is present.
let auth;
if (this._data.session) {
auth = {

View File

@@ -373,6 +373,7 @@ export function extend() {
const target = arguments[0] || {};
for (let i = 1; i < arguments.length; i++) {
const source = arguments[i];
if (!source) continue;
for (const propName in source) { // eslint-disable-line guard-for-in
target[propName] = source[propName];
}