From 4b44d5fa408528cd1796283534aad926e9ab2bfc Mon Sep 17 00:00:00 2001 From: Jozef Sovcik Date: Mon, 4 Jan 2021 10:50:59 +0100 Subject: [PATCH] docs: showing decodedToken of the connected client --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9f7d9c5..d87e4c4 100644 --- a/README.md +++ b/README.md @@ -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)