docs: showing decodedToken of the connected client

This commit is contained in:
Jozef Sovcik
2021-01-04 10:50:59 +01:00
committed by GitHub
parent 62f2ad32cf
commit 4b44d5fa40

View File

@@ -44,7 +44,10 @@ io.use(
})
)
io.on('connection', async () => {
io.on('connection', async (socket) => {
// jwt payload of the connected client
console.log(socket.decodedToken)
const clients = await io.sockets.allSockets()
for (const clientId of clients) {
const client = io.sockets.sockets.get(clientId)