mirror of
https://github.com/spacebarchat/server.git
synced 2026-03-29 14:09:52 +00:00
Log creation of new sessions, fix some comments
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user