Skip to content

Commit 9fcc0c0

Browse files
committed
Add atheme SASL AUTHCOOKIE support
1 parent e6b3ded commit 9fcc0c0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/commands/handlers/registration.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ const handlers = {
302302
const saslAuth = getSaslAuth(handler);
303303
const auth_str = saslAuth.account + '\0' +
304304
saslAuth.account + '\0' +
305-
saslAuth.password;
305+
saslAuth.secret;
306306
const b = Buffer.from(auth_str, 'utf8');
307307
const b64 = b.toString('base64');
308308

@@ -437,7 +437,9 @@ function getSaslAuth(handler) {
437437
// An account username has been given, use it for SASL auth
438438
return {
439439
account: options.account.account,
440-
password: options.account.password || '',
440+
secret: (options.sasl_mechanism.toUpperCase() === 'AUTHCOOKIE' ?
441+
options.account.authcookie :
442+
options.account.password) || '',
441443
};
442444
} else if (options.account) {
443445
// An account object existed but without auth credentials
@@ -447,7 +449,7 @@ function getSaslAuth(handler) {
447449
// for ease of use
448450
return {
449451
account: options.nick,
450-
password: options.password,
452+
secret: options.password,
451453
};
452454
}
453455

0 commit comments

Comments
 (0)