Skip to content

Commit 104183e

Browse files
committed
feat(frontend#oso): set authorization header to OSO_API_TOKEN
1 parent deeaaa5 commit 104183e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

frontend/src/oso-extensions/wrapper.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { PyodideBridge } from "@/core/wasm/bridge";
55
import { useFragmentStore } from "./fragment-store";
66
import { userConfigAtom } from "@/core/config/config";
77
import { store } from "@/core/state/jotai";
8+
import { runtimeConfigAtom } from "@/core/runtime/config";
89

910
const COMMAND_PREFIX = "oso_commands:";
1011

@@ -96,6 +97,12 @@ export const OSOWrapper: React.FC<PropsWithChildren> = ({ children }) => {
9697
},
9798
},
9899
}));
100+
101+
// Set the OSO API key as the auth token in the runtime config
102+
store.set(runtimeConfigAtom, (prev) => ({
103+
...prev,
104+
authToken: osoApiKey,
105+
}));
99106
}
100107
}
101108

0 commit comments

Comments
 (0)