From e41dca6fe33e74c20d035ad8ae874f19ce6dfede Mon Sep 17 00:00:00 2001 From: sepehr Date: Sun, 17 May 2026 20:06:26 +0200 Subject: [PATCH] fix: cache headers and frontend pro tier resolution --- .../src/app/dashboard/translate/useTranslationConfig.ts | 2 +- routes/auth_routes.py | 1 + routes/legacy_routes.py | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/dashboard/translate/useTranslationConfig.ts b/frontend/src/app/dashboard/translate/useTranslationConfig.ts index cec9a2e..b498cc3 100644 --- a/frontend/src/app/dashboard/translate/useTranslationConfig.ts +++ b/frontend/src/app/dashboard/translate/useTranslationConfig.ts @@ -178,7 +178,7 @@ export function useTranslationConfig(hasFile: boolean): UseTranslationConfigRetu if (userStr) { try { const user = JSON.parse(userStr); - if (user?.plan || user?.tier) { setIsPro(isProTier(user)); return; } + if (user?.plan || user?.tier) { setIsPro(isProTier(user)); } } catch { /* continue */ } } try { diff --git a/routes/auth_routes.py b/routes/auth_routes.py index 0d4b21a..5452186 100644 --- a/routes/auth_routes.py +++ b/routes/auth_routes.py @@ -718,6 +718,7 @@ async def refresh_v1(request: Request): async def get_me_v1(user=Depends(require_user)): return JSONResponse( status_code=200, + headers={"Cache-Control": "no-cache, no-store, must-revalidate"}, content={"data": user_to_response(user).model_dump(mode="json"), "meta": {}}, ) diff --git a/routes/legacy_routes.py b/routes/legacy_routes.py index 96824f1..9bde16c 100644 --- a/routes/legacy_routes.py +++ b/routes/legacy_routes.py @@ -225,7 +225,11 @@ async def get_available_providers(): "model": model, }) - return {"providers": available} + return JSONResponse( + status_code=200, + headers={"Cache-Control": "no-cache, no-store, must-revalidate"}, + content={"providers": available} + ) @router.get("/languages")