Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into dbkr/x_show_msisdn
Browse files Browse the repository at this point in the history
  • Loading branch information
dbkr committed Mar 15, 2017
2 parents c8868a3 + 8b4b0e0 commit 571fcbe
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/interactive-auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,16 @@ InteractiveAuth.prototype = {
// doesn't look like an interactive-auth failure. fail the whole lot.
throw error;
}
// if the error didn't come with flows or session ID,
// copy over the ones we have
if (!error.data.flows) error.data.flows = self._data.flows;
if (!error.data.session) error.data.session = self._data.session;
// if the error didn't come with flows, completed flows or session ID,
// copy over the ones we have. Synapse sometimes sends responses without
// any UI auth data (eg. when polling for email validation, if the email
// 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._startNextAuthStage();
},
Expand Down

0 comments on commit 571fcbe

Please sign in to comment.