From 6fbb654129c6650262cbb5dc25ecb90d1b25716d Mon Sep 17 00:00:00 2001 From: Christos Triantafyllidis Date: Thu, 9 Nov 2017 17:26:54 +0000 Subject: [PATCH] Allow the usage of the AUTHCOOKIE mechanism for SASL --- src/commands/handlers/registration.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/commands/handlers/registration.js b/src/commands/handlers/registration.js index d4425d54..36235e41 100644 --- a/src/commands/handlers/registration.js +++ b/src/commands/handlers/registration.js @@ -144,7 +144,11 @@ var handlers = { } if (this.network.cap.enabled.length > 0) { if (this.network.cap.isEnabled('sasl')) { - this.connection.write('AUTHENTICATE PLAIN'); + if (this.connection.options.sasl_mechanism === 'AUTHCOOKIE') { + this.connection.write('AUTHENTICATE AUTHCOOKIE'); + } else { + this.connection.write('AUTHENTICATE PLAIN'); + } } else { this.connection.write('CAP END'); this.network.cap.negotiating = false;