From 86b08296a0bd35496718c3dfcf50ea6104068421 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Sun, 21 Nov 2021 13:23:14 +0100 Subject: [PATCH] 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. --- lib/client.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/client.js b/lib/client.js index 4c159cf..7687e08 100644 --- a/lib/client.js +++ b/lib/client.js @@ -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]] });