Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix: allow authToken in mount config (#5269)

Myles Scolnick9ae652d5cfa8
diff --git a/frontend/src/core/network/api.ts b/frontend/src/core/network/api.ts
index 1971758a45..cb8ee2e2e5 100644
--- a/frontend/src/core/network/api.ts
+++ b/frontend/src/core/network/api.ts
@@ -6,7 +6,7 @@ import type { RuntimeManager } from "../runtime/runtime";
function getBaseUriWithoutQueryParams(): string {
// Remove query params and hash
- const url = new URL(document.baseURI);
+ const url = getRuntimeManager().httpURL;
url.search = "";
url.hash = "";
return url.toString();
diff --git a/frontend/src/core/runtime/types.ts b/frontend/src/core/runtime/types.ts
index 9c6ce2d304..2938982eb2 100644
--- a/frontend/src/core/runtime/types.ts
+++ b/frontend/src/core/runtime/types.ts
@@ -3,5 +3,5 @@
export interface RuntimeConfig {
url: string;
serverToken?: string; // Skew protection token
- authToken?: string; // API key or JWT token for remote backend
+ authToken?: string | null; // API key or JWT token for remote backend
}
diff --git a/frontend/src/mount.tsx b/frontend/src/mount.tsx
index 8a590e663f..745dbdcd34 100644
--- a/frontend/src/mount.tsx
+++ b/frontend/src/mount.tsx
@@ -224,7 +224,14 @@ const mountOptionsSchema = z.object({
* Runtime configs
*/
runtimeConfig: z
- .array(z.object({ url: z.string() }))
+ .array(
+ z
+ .object({
+ url: z.string(),
+ authToken: z.string().nullish(),
+ })
+ .passthrough(),
+ )
.nullish()
.transform((val) => val ?? []),
});