mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-02 21:18:36 +00:00
fixed auth
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -45,6 +45,7 @@ export function buildRankedGameConfig(
|
||||
infiniteGold: false,
|
||||
infiniteTroops: false,
|
||||
instantBuild: false,
|
||||
randomSpawn: true,
|
||||
maxTimerValue: undefined,
|
||||
|
||||
// No disabled units in ranked
|
||||
|
||||
Reference in New Issue
Block a user