io.of('/user-notifications')
.use(authenticateSocket)
.on('connection', socket => {
- const userId = socket.handshake.query.user.id
+ const userId = socket.handshake.auth.user.id
logger.debug('User %d connected on the notification system.', userId)
socket.on('subscribe', ({ videoId }) => {
if (!isIdValid(videoId)) return
+ /* eslint-disable @typescript-eslint/no-floating-promises */
socket.join(videoId)
})
socket.on('unsubscribe', ({ videoId }) => {
if (!isIdValid(videoId)) return
+ /* eslint-disable @typescript-eslint/no-floating-promises */
socket.leave(videoId)
})
})