fix(app): include basic auth

pull/13005/head
Adam 2026-02-10 12:37:17 -06:00
parent eb2587844b
commit a3aad9c9bf
No known key found for this signature in database
GPG Key ID: 9CB48779AF150E75
1 changed files with 6 additions and 0 deletions

View File

@ -11,6 +11,7 @@ export const { use: useGlobalSDK, provider: GlobalSDKProvider } = createSimpleCo
const server = useServer()
const platform = usePlatform()
const abort = new AbortController()
const password = window.__OPENCODE__?.serverPassword
// Prefer the WebView fetch implementation for streaming responses.
// @tauri-apps/plugin-http 2.5.x has known issues with streaming/cancellation that can
@ -18,6 +19,11 @@ export const { use: useGlobalSDK, provider: GlobalSDKProvider } = createSimpleCo
const eventSdk = createOpencodeClient({
baseUrl: server.url,
signal: abort.signal,
headers: password
? {
Authorization: `Basic ${btoa(`opencode:${password}`)}`,
}
: undefined,
})
const emitter = createGlobalEmitter<{
[key: string]: Event