Commit 60f86378 authored by JC Brand's avatar JC Brand

Handle reconnection on authfail edge case.

Attempt reconnection on authfail when credentials_url and auto_reconnect are set.
parent 8ef74616
......@@ -432,7 +432,16 @@
* Will either start a teardown process for converse.js or attempt
* to reconnect.
*/
if (_.includes([converse.LOGOUT, Strophe.Status.AUTHFAIL], converse.disconnection_cause) ||
if (converse.disconnection_cause === Strophe.Status.AUTHFAIL) {
if (converse.credentials_url && converse.auto_reconnect) {
/* In this case, we reconnect, because we might be receiving
* expirable tokens from the credentials_url.
*/
return converse.reconnect();
} else {
return converse.disconnect();
}
} else if (converse.disconnection_cause === converse.LOGOUT ||
converse.disconnection_reason === "host-unknown" ||
!converse.auto_reconnect) {
return converse.disconnect();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment