This commit is contained in:
Daniel Lugo 2020-11-06 10:24:49 -04:00
parent 1578cf8c58
commit 669bda34c5

View file

@ -447,14 +447,18 @@ module.exports = (
// TODO: make this sync // TODO: make this sync
async socket => { async socket => {
try { try {
logger.info('Received connect request for shockping socket')
if (!isAuthenticated()) { if (!isAuthenticated()) {
logger.info(
'not authenticated in gun for shockping socket, will send NOT_AUTH'
)
socket.emit(Common.Constants.ErrorCode.NOT_AUTH) socket.emit(Common.Constants.ErrorCode.NOT_AUTH)
return return
} }
logger.info('now checking token')
const { token } = socket.handshake.query const { token } = socket.handshake.query
const isAuth = await isValidToken(token) const isAuth = await isValidToken(token)
if (!isAuth) { if (!isAuth) {