mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
Update ui/litellm-dashboard/src/utils/cookieUtils.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
parent
2c5caac531
commit
04f835ecfa
1 changed files with 1 additions and 1 deletions
|
|
@ -64,5 +64,5 @@ 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 ? decodeURIComponent(cookieValue.split("=")[1]) : null;
|
||||
return cookieValue ? (() => { try { return decodeURIComponent(cookieValue.split("=")[1]); } catch { return cookieValue.split("=")[1]; } })() : null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue