fix: cache headers and frontend pro tier resolution
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m34s
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m34s
This commit is contained in:
@@ -178,7 +178,7 @@ export function useTranslationConfig(hasFile: boolean): UseTranslationConfigRetu
|
|||||||
if (userStr) {
|
if (userStr) {
|
||||||
try {
|
try {
|
||||||
const user = JSON.parse(userStr);
|
const user = JSON.parse(userStr);
|
||||||
if (user?.plan || user?.tier) { setIsPro(isProTier(user)); return; }
|
if (user?.plan || user?.tier) { setIsPro(isProTier(user)); }
|
||||||
} catch { /* continue */ }
|
} catch { /* continue */ }
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -718,6 +718,7 @@ async def refresh_v1(request: Request):
|
|||||||
async def get_me_v1(user=Depends(require_user)):
|
async def get_me_v1(user=Depends(require_user)):
|
||||||
return JSONResponse(
|
return JSONResponse(
|
||||||
status_code=200,
|
status_code=200,
|
||||||
|
headers={"Cache-Control": "no-cache, no-store, must-revalidate"},
|
||||||
content={"data": user_to_response(user).model_dump(mode="json"), "meta": {}},
|
content={"data": user_to_response(user).model_dump(mode="json"), "meta": {}},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -225,7 +225,11 @@ async def get_available_providers():
|
|||||||
"model": model,
|
"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")
|
@router.get("/languages")
|
||||||
|
|||||||
Reference in New Issue
Block a user