mirror of
https://github.com/spacebarchat/server.git
synced 2026-03-30 13:55:39 +00:00
Log usage of old access token versions in identify
This commit is contained in:
@@ -141,6 +141,17 @@ export async function onIdentify(this: WebSocket, data: Payload) {
|
||||
isNewSession: true,
|
||||
};
|
||||
|
||||
if (tokenData.tokenVersion < CurrentTokenFormatVersion)
|
||||
console.warn(
|
||||
"[Identify/WARN] Access token version",
|
||||
tokenData.tokenVersion,
|
||||
"used by user",
|
||||
tokenData.user.id,
|
||||
`(${tokenData.user.tag})! - Client`,
|
||||
this.capabilities.has(Capabilities.FLAGS.AUTH_TOKEN_REFRESH) ? "did" : "did not",
|
||||
"opt for token refresh.",
|
||||
);
|
||||
|
||||
this.session = session;
|
||||
this.session.status = identify.presence?.status || "online";
|
||||
this.session.last_seen = new Date();
|
||||
|
||||
Reference in New Issue
Block a user