diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index 5ef94783a8a..de57e8cd969 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -11486,7 +11486,7 @@ async def login_v3_exchange(request: Request): }, status_code=status.HTTP_200_OK, ) - json_response.set_cookie(key="token", value=cached_data["token"]) + json_response.set_cookie(key="token", value=cached_data["token"], httponly=True) return json_response except ProxyException: raise diff --git a/ui/litellm-dashboard/src/components/networking.tsx b/ui/litellm-dashboard/src/components/networking.tsx index b3e75f35287..f3adb0fb179 100644 --- a/ui/litellm-dashboard/src/components/networking.tsx +++ b/ui/litellm-dashboard/src/components/networking.tsx @@ -9166,6 +9166,7 @@ export const exchangeLoginCode = async (code: string, workerBaseUrl?: string | n const response = await fetch(`${base}/v3/login/exchange`, { method: "POST", body: JSON.stringify({ code }), + credentials: "include", headers: { "Content-Type": "application/json" }, }); @@ -9176,7 +9177,7 @@ export const exchangeLoginCode = async (code: string, workerBaseUrl?: string | n const data = await response.json(); if (data.token) { - document.cookie = `token=${data.token}; path=/; SameSite=Lax`; + storeLoginToken(data.token); } return data.token; };