Add encryption toggle to Socket callbacks

This commit is contained in:
emad-salah 2021-04-25 21:32:46 +00:00
parent 19058dac09
commit 9f7dafaebb

View file

@ -148,6 +148,10 @@ const encryptedOn = socket => (eventName, callback) => {
*/ */
const encryptedCallback = (socket, callback) => async (...args) => { const encryptedCallback = (socket, callback) => async (...args) => {
try { try {
if (process.env.SHOCK_ENCRYPTION_ECC === 'false') {
return callback(...args)
}
const deviceId = socket.handshake.auth.encryptionId const deviceId = socket.handshake.auth.encryptionId
if (!deviceId) { if (!deviceId) {