Restructure to activeclient so it always has DiscordId object for active token (if active)
All checks were successful
release-image / release-image (push) Successful in 2m8s

This commit is contained in:
Logan Cusano
2025-06-29 18:19:56 -04:00
parent 7e538b693e
commit bcff5a4981
3 changed files with 10 additions and 5 deletions

View File

@@ -43,6 +43,11 @@ async def websocket_server_handler(websocket):
client_id = handshake_data["id"]
client_nickname = handshake_data.get("nickname")
client_active_token = handshake_data.get("active_token")
# Get the DiscordId for the passed token
if client_active_token:
active_discord_id = await app.d_id_db_h.find_discord_id({"token":client_active_token})
if active_discord_id:
client_active_token = active_discord_id
await register_client(websocket, client_id, client_nickname, client_active_token)
if not app.active_clients[client_id].access_token:
abort(500, "Error retrieving access token")