Log creation of new sessions, fix some comments

This commit is contained in:
Rory&
2026-03-06 00:25:59 +01:00
parent b5c376881d
commit 3f756629e6
2 changed files with 16 additions and 2 deletions

View File

@@ -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",

View File

@@ -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;
};
};