summary refs log tree commit diff
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-03-06 00:25:59 +0100
committerRory& <root@rory.gay>2026-03-06 00:25:59 +0100
commit3f756629e61c19eff57bd35c809585b77706f8e2 (patch)
treee80c4577db42fc47047bcf6157d375db8ddec023
parentInline pointless const for session_id (diff)
downloadserver-ts-3f756629e61c19eff57bd35c809585b77706f8e2.tar.xz
Log creation of new sessions, fix some comments
-rw-r--r--src/gateway/opcodes/Identify.ts12
-rw-r--r--src/util/util/Token.ts6
2 files changed, 16 insertions, 2 deletions
diff --git a/src/gateway/opcodes/Identify.ts b/src/gateway/opcodes/Identify.ts

index 00fbf650..4be3be73 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 ba5d427d..81063ec0 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; }; };