From 22409da93210166eb28540ee75f144866efcf2e8 Mon Sep 17 00:00:00 2001 From: Hendrik Jaks Date: Fri, 13 Mar 2026 10:22:32 +0200 Subject: [PATCH] Update ui/litellm-dashboard/src/utils/cookieUtils.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- ui/litellm-dashboard/src/utils/cookieUtils.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ui/litellm-dashboard/src/utils/cookieUtils.ts b/ui/litellm-dashboard/src/utils/cookieUtils.ts index 07a782686c9..6fe43f30400 100644 --- a/ui/litellm-dashboard/src/utils/cookieUtils.ts +++ b/ui/litellm-dashboard/src/utils/cookieUtils.ts @@ -64,5 +64,12 @@ export function setTokenCookie(token: string) { export function getCookie(name: string) { if (typeof document === "undefined") return null; const cookieValue = document.cookie.split("; ").find((row) => row.startsWith(name + "=")); - return cookieValue ? (() => { try { return decodeURIComponent(cookieValue.split("=")[1]); } catch { return cookieValue.split("=")[1]; } })() : null; + if (!cookieValue) return null; + const rawValue = cookieValue.split("=")[1]; + try { + return decodeURIComponent(rawValue); + } catch { + return rawValue; + } +} }