From e9376c1d25c727e040daf396aad7333df830f584 Mon Sep 17 00:00:00 2001 From: Trajkov Dimitar Date: Mon, 8 Dec 2025 22:23:37 +0100 Subject: [PATCH] fixed auth --- src/client/RankedQueue.ts | 7 ++++--- src/server/RankedGameConfig.ts | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/client/RankedQueue.ts b/src/client/RankedQueue.ts index 80467302b..ccdb782f5 100644 --- a/src/client/RankedQueue.ts +++ b/src/client/RankedQueue.ts @@ -1,9 +1,10 @@ import { LitElement, html } from "lit"; import { customElement, state } from "lit/decorators.js"; import { generateID } from "../core/Util"; +import { getApiBase, getUserMe } from "./Api"; +import { userAuth } from "./Auth"; import { JoinLobbyEvent } from "./Main"; import { translateText } from "./Utils"; -import { getApiBase, getUserMe, isLoggedIn } from "./jwt"; type QueueType = "ranked" | "unranked"; type GameMode = "ffa" | "team"; @@ -126,12 +127,12 @@ export class RankedQueue extends LitElement { try { // Get authentication information - const loginResult = isLoggedIn(); + const loginResult = await userAuth(); if (loginResult === false) { throw new Error("Please log in to join ranked matchmaking"); } - const token = loginResult.token; + const token = loginResult.jwt; // Determine WebSocket URL based on environment // In development, use local matchmaking server; in production, use API diff --git a/src/server/RankedGameConfig.ts b/src/server/RankedGameConfig.ts index ebde6ca68..b3772557f 100644 --- a/src/server/RankedGameConfig.ts +++ b/src/server/RankedGameConfig.ts @@ -45,6 +45,7 @@ export function buildRankedGameConfig( infiniteGold: false, infiniteTroops: false, instantBuild: false, + randomSpawn: true, maxTimerValue: undefined, // No disabled units in ranked