From 67c10bae25350a54ffb06052011035c6b84534c8 Mon Sep 17 00:00:00 2001 From: Inferencebot Date: Sun, 8 Nov 2026 02:06:50 +0000 Subject: [PATCH] =?UTF-8?q?dashboard:=20guest=20accounts=20=E2=80=94=20no?= =?UTF-8?q?=20Matrix=20section,=20Become-a-member=20instead=20of=20buy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gift accounts (portal flag on /broker/usage) get a different dashboard: the Matrix card is hidden in the markup and only revealed for members (a guest never sees it, even before the usage fetch returns), the credit-pack buy button becomes 'Become a member' pointing at the OC contribution page, and the meta line names the gift. Everything else (spend, models, keys, docs links) unchanged. --- app/main.py | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/app/main.py b/app/main.py index c4c743f..8176268 100644 --- a/app/main.py +++ b/app/main.py @@ -40,6 +40,12 @@ BROKER_SECRET = os.environ.get("BROKER_SECRET", "") DEFAULT_CREDIT_PACK_URL = "https://opencollective.com/inference-cooperative/contribute" CREDIT_PACK_URL = (os.environ.get("CREDIT_PACK_URL") or "").strip() or DEFAULT_CREDIT_PACK_URL +# Where a GUEST account's "Become a member" button points (the contribution +# page — what actually starts a membership). Deliberately independent of +# CREDIT_PACK_URL: a guest needs a membership, not a credit pack, even if the +# credit-pack link is ever repointed at a pack page. +BECOME_MEMBER_URL = "https://opencollective.com/inference-cooperative/contribute" + app = FastAPI() @@ -311,6 +317,7 @@ def render_page(identity: str) -> str: return ( PAGE_HTML.replace("@@IDENTITY@@", _esc(identity)) .replace("@@CREDIT_PACK_URL@@", _esc(CREDIT_PACK_URL)) + .replace("@@BECOME_MEMBER_URL@@", _esc(BECOME_MEMBER_URL)) ) @@ -590,7 +597,7 @@ PAGE_HTML = """
Shared across chat and API.
- Buy a credit pack + Buy a credit pack Credit packs never expire · used after your monthly allowance More about allowance & credits → @@ -656,7 +663,7 @@ PAGE_HTML = """
-
+