lib/client: don't disconnect on SASL error if registered

This will let users try multiple auth attempts when we'll implement
post-registration auth.
This commit is contained in:
Simon Ser 2021-11-21 13:23:14 +01:00
parent 25dd6aabf6
commit 86b08296a0

View file

@ -322,7 +322,9 @@ export default class Client extends EventTarget {
case irc.ERR_SASLABORTED:
case irc.ERR_SASLALREADY:
this.dispatchEvent(new CustomEvent("error", { detail: "SASL error (" + msg.command + "): " + msg.params[1] }));
this.disconnect();
if (this.status !== Client.Status.REGISTERED) {
this.disconnect();
}
break;
case "PING":
this.send({ command: "PONG", params: [msg.params[0]] });