diff options
| author | Adam <[email protected]> | 2026-02-10 12:37:17 -0600 |
|---|---|---|
| committer | Adam <[email protected]> | 2026-02-10 12:37:28 -0600 |
| commit | a3aad9c9bf57e8344a4ba5be53d81c812b297a3a (patch) | |
| tree | 7b2430cc3aa75d2362cfa53418cd11332b0dc89a /packages | |
| parent | eb2587844b1ac89d6b888467215f3a5420fc7037 (diff) | |
| download | opencode-a3aad9c9bf57e8344a4ba5be53d81c812b297a3a.tar.gz opencode-a3aad9c9bf57e8344a4ba5be53d81c812b297a3a.zip | |
fix(app): include basic auth
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/app/src/context/global-sdk.tsx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/app/src/context/global-sdk.tsx b/packages/app/src/context/global-sdk.tsx index af4bbdccc..5708fe92f 100644 --- a/packages/app/src/context/global-sdk.tsx +++ b/packages/app/src/context/global-sdk.tsx @@ -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 |
