From 8ccb0bb89b4ebf00365763bf47a5b6f910a436ed Mon Sep 17 00:00:00 2001 From: Ryan Barlow <7389646+ryanbarlow97@users.noreply.github.com> Date: Mon, 25 May 2026 21:26:56 +0100 Subject: [PATCH] prevent opening modal --- src/client/ClanTagInput.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/client/ClanTagInput.ts b/src/client/ClanTagInput.ts index 8d147bd24..6c0cb0dbe 100644 --- a/src/client/ClanTagInput.ts +++ b/src/client/ClanTagInput.ts @@ -173,8 +173,10 @@ export class ClanTagInput extends LitElement { } } - // Are you a member? If not, does the clan exist? If it doesn't (fictional) - // or the check fails open, accept. Otherwise reject. + // Are you a member? If not, only accept when the API confirms the clan + // doesn't exist (fictional). Inconclusive results (null/timeout) reject so + // the client matches the server's fail-closed enforcement — otherwise the + // client would let the modal open with a tag the server later drops. private async checkOwnership(tag: string) { const checkId = this.checkCounter; const stillCurrent = () => @@ -189,7 +191,7 @@ export class ClanTagInput extends LitElement { if (!myTags.includes(tag.toUpperCase())) { const exists = await fetchClanExists(tag); if (!stillCurrent()) return; - if (exists === true) { + if (exists !== false) { this.reject(tag); return; }