1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-09 10:22:46 +03:00

Fix tests

This commit is contained in:
David Baker
2017-02-28 13:44:44 +00:00
parent 6eebd1e957
commit 08a3aea1c7
2 changed files with 25 additions and 12 deletions

View File

@@ -222,12 +222,13 @@ InteractiveAuth.prototype = {
self._completionDeferred.resolve(result);
}, function(error) {
// sometimes UI auth errors don't come with flows
const haveFlows = Boolean(self._data.flows) || Boolean(error.data.flows);
const errorFlows = error.data ? error.data.flows : null;
const haveFlows = Boolean(self._data.flows) || Boolean(errorFlows);
if (error.httpStatus !== 401 || !error.data || !haveFlows) {
// doesn't look like an interactive-auth failure. fail the whole lot.
throw error;
}
if (error.data.flows) self._data = error.data;
if (errorFlows) self._data = error.data;
self._startNextAuthStage();
},
);