studio: fix api-keys access + refresh (#5005)

* studio: fix api-keys access + refresh

* studio: guard v1 in spa fallback
This commit is contained in:
Wasim Yousef Said 2026-04-13 21:48:51 +02:00 committed by GitHub
commit 97eafd999e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View file

@ -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()

View file

@ -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;