From eb7b713590a50a995beee9dc08bbc84aa7d30719 Mon Sep 17 00:00:00 2001 From: luke Date: Tue, 24 Jun 2025 22:53:31 +0800 Subject: [PATCH] fix --- scripts/llm.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/llm.js b/scripts/llm.js index b28025e..65a9204 100644 --- a/scripts/llm.js +++ b/scripts/llm.js @@ -274,6 +274,12 @@ function promptLLMPasswordModal() { async function getLLMToken(forceRefresh = false) { const config = await loadMergedConfig(); + const auth = await loadUserToken(); + if (!auth) { + handleLogout(auth); + return; + } + const userToken = auth.token; const tokenCfg = config.apiConfig.llmToken; const expireMs = config.llmTokenExpireHours * 60 * 60 * 1000; @@ -298,7 +304,7 @@ async function getLLMToken(forceRefresh = false) { method: "POST", headers: { "Content-Type": "application/json", - "Authorization": "test" + "Authorization": `${userToken}` }, body: JSON.stringify(body) });