You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-08-09 10:22:46 +03:00
Save the completed flows (#389)
Otherwise we get very confused and go back to the start when given a response with no flows etc. Only copy data if none of the 3 fields are defined, since that's more the situation we actually want to handle.
This commit is contained in:
committed by
Richard van der Hoff
parent
49be37dcf9
commit
8b4b0e0d39
@@ -272,10 +272,16 @@ InteractiveAuth.prototype = {
|
|||||||
// doesn't look like an interactive-auth failure. fail the whole lot.
|
// doesn't look like an interactive-auth failure. fail the whole lot.
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
// if the error didn't come with flows or session ID,
|
// if the error didn't come with flows, completed flows or session ID,
|
||||||
// copy over the ones we have
|
// copy over the ones we have. Synapse sometimes sends responses without
|
||||||
if (!error.data.flows) error.data.flows = self._data.flows;
|
// any UI auth data (eg. when polling for email validation, if the email
|
||||||
if (!error.data.session) error.data.session = self._data.session;
|
// has not yet been validated). This appears to be a Synapse bug, which
|
||||||
|
// we workaround here.
|
||||||
|
if (!error.data.flows && !error.data.completed && !error.data.session) {
|
||||||
|
error.data.flows = self._data.flows;
|
||||||
|
error.data.completed = self._data.completed;
|
||||||
|
error.data.session = self._data.session;
|
||||||
|
}
|
||||||
self._data = error.data;
|
self._data = error.data;
|
||||||
self._startNextAuthStage();
|
self._startNextAuthStage();
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user