martynsmith / node-irc

NodeJS IRC client library
GNU General Public License v3.0
1.33k stars 424 forks source link

Update irc.js for SASL auth against inspircd/anope #570

Open jmcparland opened 2 years ago

jmcparland commented 2 years ago

As is, SASL authentication fails against InspIRCd 3.10.0 & Anope 2.0.9 (FreeBSD). Checking the arguments in the CAP message, arg 2 presents as 'sasl' without a trailing space. In this particular case, removing the space allows successful authentication. Checking that the string.startsWith('sasl') presumably handles both cases without introducing much risk. [Alternatively, we can check against both strings explicitly.]