From 60ba8790610ecfcd864c1640f6476b8c1f20ffc8 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Tue, 16 Jul 2024 17:27:02 -0700 Subject: [PATCH] ui - clear cookies on logout --- ui/litellm-dashboard/src/components/navbar.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ui/litellm-dashboard/src/components/navbar.tsx b/ui/litellm-dashboard/src/components/navbar.tsx index 6f33d1691..66d4c703e 100644 --- a/ui/litellm-dashboard/src/components/navbar.tsx +++ b/ui/litellm-dashboard/src/components/navbar.tsx @@ -57,7 +57,12 @@ const Navbar: React.FC = ({ console.log("logoutUrl=", logoutUrl); - + const handleLogout = () => { + // Clear cookies + document.cookie = "token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"; + window.location.href = logoutUrl; + } + const items: MenuProps["items"] = [ { @@ -72,11 +77,7 @@ const Navbar: React.FC = ({ }, { key: "2", - label: ( - -

Logout

-
- ), + label:

Logout

, } ];