Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix: allow CLI auth on self-hosted deployments

Richie McIlroy9b26d82f94fb
diff --git a/apps/web/__tests__/unit/proxy-self-hosted.test.ts b/apps/web/__tests__/unit/proxy-self-hosted.test.ts
new file mode 100644
index 000000000..ad20bffdb
--- /dev/null
+++ b/apps/web/__tests__/unit/proxy-self-hosted.test.ts
@@ -0,0 +1,10 @@
+import { readFileSync } from "node:fs";
+import { join } from "node:path";
+import { describe, expect, it } from "vitest";
+
+describe("self-hosted proxy routes", () => {
+ it("allows browser-based CLI authorization pages", () => {
+ const source = readFileSync(join(process.cwd(), "proxy.ts"), "utf8");
+ expect(source).toContain('path.startsWith("/cli/")');
+ });
+});
diff --git a/apps/web/proxy.ts b/apps/web/proxy.ts
index a14c79ea4..34ef67620 100644
--- a/apps/web/proxy.ts
+++ b/apps/web/proxy.ts
@@ -45,6 +45,7 @@ export async function proxy(request: NextRequest) {
!(
path.startsWith("/s/") ||
path.startsWith("/c/") ||
+ path.startsWith("/cli/") ||
path.startsWith("/middleware") ||
path.startsWith("/dashboard") ||
path.startsWith("/onboarding") ||