added backend check

This commit is contained in:
AngelRionCervi 2020-08-10 17:00:05 +02:00
parent c6409f330d
commit e79bdec70d

View file

@ -72,7 +72,7 @@ module.exports = namespace => {
socket.on('users:disconnect', data => {
const id = data.id;
if (typeof id !== 'number') return;
if (typeof id !== 'number' || !socket._user.admin) return;
Object.values(namespace.sockets)
.filter(socket => socket._user.id === id)
.forEach(socket => socket.disconnect());