Fix no auth bug

This commit is contained in:
emad-salah 2021-05-08 13:07:02 +00:00
parent 48af24fd3d
commit 930b4a048b

View file

@ -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 {