Merge pull request #379 from shocknet/bug/no-auth-event

Fix no auth bug
This commit is contained in:
CapDog 2021-05-10 12:33:49 -04:00 committed by GitHub
commit 03d73e1067

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 {