fix
This commit is contained in:
parent
036174596b
commit
eb7b713590
@ -274,6 +274,12 @@ function promptLLMPasswordModal() {
|
|||||||
|
|
||||||
async function getLLMToken(forceRefresh = false) {
|
async function getLLMToken(forceRefresh = false) {
|
||||||
const config = await loadMergedConfig();
|
const config = await loadMergedConfig();
|
||||||
|
const auth = await loadUserToken();
|
||||||
|
if (!auth) {
|
||||||
|
handleLogout(auth);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const userToken = auth.token;
|
||||||
const tokenCfg = config.apiConfig.llmToken;
|
const tokenCfg = config.apiConfig.llmToken;
|
||||||
const expireMs = config.llmTokenExpireHours * 60 * 60 * 1000;
|
const expireMs = config.llmTokenExpireHours * 60 * 60 * 1000;
|
||||||
|
|
||||||
@ -298,7 +304,7 @@ async function getLLMToken(forceRefresh = false) {
|
|||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
"Authorization": "test"
|
"Authorization": `${userToken}`
|
||||||
},
|
},
|
||||||
body: JSON.stringify(body)
|
body: JSON.stringify(body)
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user