studio: fix api-keys access + refresh (#5005)
* studio: fix api-keys access + refresh * studio: guard v1 in spa fallback
This commit is contained in:
parent
d2fc582840
commit
97eafd999e
2 changed files with 9 additions and 2 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue