From 48b74ddd0a25f9115340e0c9b6563a3f946166d8 Mon Sep 17 00:00:00 2001 From: Scott Anderson <662325+scottanderson@users.noreply.github.com> Date: Wed, 14 May 2025 22:15:11 -0400 Subject: [PATCH] src/core/configuration/DefaultConfig.ts --- src/core/configuration/DefaultConfig.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/configuration/DefaultConfig.ts b/src/core/configuration/DefaultConfig.ts index d3ab3a2df..e943ed4f0 100644 --- a/src/core/configuration/DefaultConfig.ts +++ b/src/core/configuration/DefaultConfig.ts @@ -50,6 +50,7 @@ export abstract class DefaultServerConfig implements ServerConfig { async jwkPublicKey(): Promise { if (this.publicKey) return this.publicKey; const jwksUrl = this.jwtIssuer() + "/.well-known/jwks.json"; + console.log(`Fetching JWKS from ${jwksUrl}`); const response = await fetch(jwksUrl); const jwks = JwksSchema.parse(await response.json()); this.publicKey = jwks.keys[0]; @@ -186,7 +187,7 @@ export class DefaultConfig implements Config { constructor( private _serverConfig: ServerConfig, private _gameConfig: GameConfig, - private _userSettings: UserSettings, + private _userSettings: UserSettings | null, private _isReplay: boolean, ) {} isReplay(): boolean { @@ -220,6 +221,9 @@ export class DefaultConfig implements Config { } userSettings(): UserSettings { + if (this._userSettings === null) { + throw new Error("userSettings is null"); + } return this._userSettings; }