diff --git a/src/server/ws/index.ts b/src/server/ws/index.ts index bc2643a..c2c67c4 100644 --- a/src/server/ws/index.ts +++ b/src/server/ws/index.ts @@ -29,6 +29,11 @@ export function initSocketio(httpServer: HTTPServer) { if (token) { user = jwtVerify(token); + logger.info( + '[WebSocket] Authenticated via JWT:', + user.id, + user.username + ); } else { const session = await getAuthSession( socket.request, @@ -43,10 +48,13 @@ export function initSocketio(httpServer: HTTPServer) { username: session.user.name, role: session.user.role, }; + logger.info( + '[WebSocket] Authenticated via Session:', + user.id, + user.username + ); } - logger.info('[Socket] Authenticated via JWT:', user.id, user.username); - socket.data.user = user; socket.data.token = token;