mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
fix: use storeLoginToken in exchangeLoginCode, add credentials include
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
086c41640c
commit
866405f443
2 changed files with 3 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue