From e918f771fad808276e721db480c4e0102c8253bb Mon Sep 17 00:00:00 2001 From: Rory& Date: Wed, 25 Feb 2026 07:05:19 +0100 Subject: [PATCH] Log usage of old access token versions in identify --- src/gateway/opcodes/Identify.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/gateway/opcodes/Identify.ts b/src/gateway/opcodes/Identify.ts index 9b9e1d14c..00fbf6501 100644 --- a/src/gateway/opcodes/Identify.ts +++ b/src/gateway/opcodes/Identify.ts @@ -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();