From 97eafd999e4e82835afedfb87b56b87b2167c34d Mon Sep 17 00:00:00 2001 From: Wasim Yousef Said Date: Mon, 13 Apr 2026 21:48:51 +0200 Subject: [PATCH] studio: fix api-keys access + refresh (#5005) * studio: fix api-keys access + refresh * studio: guard v1 in spa fallback --- studio/backend/main.py | 2 +- studio/frontend/src/app/routes/__root.tsx | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/studio/backend/main.py b/studio/backend/main.py index c2c0a0b6e4..8a40791c06 100644 --- a/studio/backend/main.py +++ b/studio/backend/main.py @@ -353,7 +353,7 @@ def setup_frontend(app: FastAPI, build_path: Path): @app.get("/{full_path:path}") async def serve_frontend(full_path: str): - if full_path.startswith("api"): + if full_path in {"api", "v1"} or full_path.startswith(("api/", "v1/")): return {"error": "API endpoint not found"} file_path = (build_path / full_path).resolve() diff --git a/studio/frontend/src/app/routes/__root.tsx b/studio/frontend/src/app/routes/__root.tsx index bac9205303..e1bbdc03f7 100644 --- a/studio/frontend/src/app/routes/__root.tsx +++ b/studio/frontend/src/app/routes/__root.tsx @@ -13,7 +13,14 @@ import { AnimatePresence, motion } from "motion/react"; import { Suspense } from "react"; import { AppProvider } from "../provider"; -const CHAT_ONLY_ALLOWED = new Set(["/", "/chat", "/login", "/signup", "/change-password"]); +const CHAT_ONLY_ALLOWED = new Set([ + "/", + "/chat", + "/login", + "/signup", + "/change-password", + "/api-keys", +]); function isChatOnlyAllowed(pathname: string): boolean { if (CHAT_ONLY_ALLOWED.has(pathname)) return true;