From d7a14f9002d0050bcaf1186ba94a8975c997a9a5 Mon Sep 17 00:00:00 2001 From: MdHusainThekiya Date: Sun, 11 Jun 2023 16:20:19 +0530 Subject: [PATCH] added check of frozen object to avoid type error --- src/broker/saslAuthenticator/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/broker/saslAuthenticator/index.js b/src/broker/saslAuthenticator/index.js index ddd1f906c..7a31e67f5 100644 --- a/src/broker/saslAuthenticator/index.js +++ b/src/broker/saslAuthenticator/index.js @@ -66,6 +66,9 @@ module.exports = class SASLAuthenticator { !this.connection.sasl.authenticationProvider && Object.keys(BUILT_IN_AUTHENTICATION_PROVIDERS).includes(mechanism) ) { + if (Object.isFrozen(this.connection.sasl)) { + this.connection.sasl = Object.assign({}, this.connection.sasl) + } this.connection.sasl.authenticationProvider = BUILT_IN_AUTHENTICATION_PROVIDERS[mechanism]( this.connection.sasl )