Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

Streamline session expiration in UI (#11279)

Isaac Whitfieldc698cc24aac5
diff --git a/ui/litellm-dashboard/src/components/networking.tsx b/ui/litellm-dashboard/src/components/networking.tsx
index 35167fe7306..5edce01f7b0 100644
--- a/ui/litellm-dashboard/src/components/networking.tsx
+++ b/ui/litellm-dashboard/src/components/networking.tsx
@@ -67,13 +67,8 @@ export interface CredentialsResponse {
credentials: CredentialItem[];
}
-
-const baseUrl = "/"; // Assuming the base URL is the root
-
-
let lastErrorTime = 0;
-const sleep = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));
const handleError = async (errorData: string) => {
const currentTime = Date.now();
@@ -81,9 +76,8 @@ const handleError = async (errorData: string) => {
if (errorData.includes("Authentication Error - Expired Key")) {
message.info("UI Session Expired. Logging out.");
lastErrorTime = currentTime;
- await sleep(3000); // 5 second sleep
document.cookie = "token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
- window.location.href = baseUrl;
+ window.location.href = window.location.pathname;
}
lastErrorTime = currentTime;
} else {