From 3f756629e61c19eff57bd35c809585b77706f8e2 Mon Sep 17 00:00:00 2001 From: Rory& Date: Fri, 6 Mar 2026 00:25:59 +0100 Subject: [PATCH] Log creation of new sessions, fix some comments --- src/gateway/opcodes/Identify.ts | 12 ++++++++++++ src/util/util/Token.ts | 6 ++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/gateway/opcodes/Identify.ts b/src/gateway/opcodes/Identify.ts index 00fbf6501..4be3be739 100644 --- a/src/gateway/opcodes/Identify.ts +++ b/src/gateway/opcodes/Identify.ts @@ -141,6 +141,18 @@ export async function onIdentify(this: WebSocket, data: Payload) { isNewSession: true, }; + if (isNewSession) + console.warn( + "[Identify/WARN] Created new session", + session.session_id, + "for user", + tokenData.user.id, + `(${tokenData.user.tag})! - Access token version`, + tokenData.tokenVersion, + "- Access token session ID:", + tokenData.decoded.did ?? "(undefined)", + ); + if (tokenData.tokenVersion < CurrentTokenFormatVersion) console.warn( "[Identify/WARN] Access token version", diff --git a/src/util/util/Token.ts b/src/util/util/Token.ts index ba5d427da..81063ec0f 100644 --- a/src/util/util/Token.ts +++ b/src/util/util/Token.ts @@ -42,8 +42,10 @@ export type UserTokenData = { decoded: { id: string; iat: number; - ver?: number; // token format version - did?: string; // device id + // token format version + ver?: number; + // device id + did?: string; }; };