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:
Hendrik Jaks 2026-03-30 09:54:24 +03:00
parent 086c41640c
commit 866405f443
2 changed files with 3 additions and 2 deletions

View file

@ -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

View file

@ -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;
};