This commit is contained in:
Timothy Jaeryang Baek committed 2026-03-26 18:13:18 -05:00
1 parent 11f52921dc
commit a641325707
6 files changed
+98 -15

No files matched your search

+34
View File
@@ -308,6 +308,40 @@ export const putOrchestratorPolicy = async (
return res;
};
/**
* Verify a terminal server connection via the backend proxy.
* Used for system/admin connections to avoid CORS issues and API key exposure.
*/
export const verifyTerminalServerConnection = async (token: string, connection: object) => {
let error = null;
const res = await fetch(`${WEBUI_API_BASE_URL}/configs/terminal_servers/verify`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${token}`
},
body: JSON.stringify({
...connection
})
})
.then(async (res) => {
if (!res.ok) throw await res.json();
return res.json();
})
.catch((err) => {
console.error(err);
error = err.detail;
return null;
});
if (error) {
throw error;
}
return res;
};
export const verifyToolServerConnection = async (token: string, connection: object) => {
let error = null;