From 930b4a048b7fac96bb1974892e197b7ca9a6c7c9 Mon Sep 17 00:00:00 2001 From: emad-salah Date: Sat, 8 May 2021 13:07:02 +0000 Subject: [PATCH] Fix no auth bug --- services/gunDB/sockets/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/gunDB/sockets/index.js b/services/gunDB/sockets/index.js index f1d24708..18acaf9e 100644 --- a/services/gunDB/sockets/index.js +++ b/services/gunDB/sockets/index.js @@ -238,6 +238,11 @@ const startSocket = socket => { const on = encryptedOn(socket) const { encryptionId } = socket.handshake.auth + if (!isAuthenticated()) { + logger.warn('GunDB is not yet authenticated') + socket.emit(Common.Constants.ErrorCode.NOT_AUTH) + } + on('subscribe:query', ({ $shock, publicKey }, response) => { const subscriptionId = uuidv4() try {