diff --git a/bun.lock b/bun.lock
index b47b0eb6b..e4fab04b0 100644
--- a/bun.lock
+++ b/bun.lock
@@ -6,6 +6,7 @@
"name": "@corbits/code",
"dependencies": {
"@corbits/codex-provider": "github:corbitsdev/corbits-codex-provider",
+ "@corbits/oauth-core": "github:corbitsdev/corbits-oauth-core",
"@corbits/openai-responses": "github:corbitsdev/corbits-openai-responses",
"@corbits/xai-provider": "github:corbitsdev/corbits-xai-provider",
"@intx/agent": "workspace:*",
@@ -774,7 +775,7 @@
"zod-to-json-schema": ["zod-to-json-schema@3.25.2", "", { "peerDependencies": { "zod": "^3.25.28 || ^4" } }, "sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA=="],
- "@corbits/codex-provider/@corbits/openai-responses": ["@corbits/openai-responses@github:corbitsdev/corbits-openai-responses#1d20dbb", { "dependencies": { "arktype": "2.2.3" }, "peerDependencies": { "@intx/inference": ">=0.3.0", "@intx/types": ">=0.3.0" } }, "corbitsdev-corbits-openai-responses-1d20dbb", "sha512-lSJz1KkKD8mEUYiQ57dJprD9JavdJGt3OBRa42tvXLsikt1fJ6qX2mGCwaEXzkfZNc2XY5o7ZpxK5swSJX+LnA=="],
+ "@corbits/codex-provider/@corbits/oauth-core": ["@corbits/oauth-core@github:corbitsdev/corbits-oauth-core#e1e69e6", { "dependencies": { "arktype": "2.2.3" } }, "corbitsdev-corbits-oauth-core-e1e69e6", "sha512-wUrD73iVyk/Dtb4yRn3hCh6N8syfsEvAkRz4XYqT0FIB3sYDSMYEWHcDMJx9nq64my/HBOeN1J6PHIOtpjhtPg=="],
"@corbits/xai-provider/@corbits/oauth-core": ["@corbits/oauth-core@github:corbitsdev/corbits-oauth-core#e1e69e6", { "dependencies": { "arktype": "2.2.3" } }, "corbitsdev-corbits-oauth-core-e1e69e6", "sha512-wUrD73iVyk/Dtb4yRn3hCh6N8syfsEvAkRz4XYqT0FIB3sYDSMYEWHcDMJx9nq64my/HBOeN1J6PHIOtpjhtPg=="],
diff --git a/package.json b/package.json
index 5e55c6d65..52ef8f11a 100644
--- a/package.json
+++ b/package.json
@@ -81,6 +81,7 @@
},
"dependencies": {
"@corbits/codex-provider": "github:corbitsdev/corbits-codex-provider",
+ "@corbits/oauth-core": "github:corbitsdev/corbits-oauth-core",
"@corbits/openai-responses": "github:corbitsdev/corbits-openai-responses",
"@corbits/xai-provider": "github:corbitsdev/corbits-xai-provider",
"@intx/agent": "workspace:*",
diff --git a/src/auth/callback-page.test.ts b/src/auth/callback-page.test.ts
index bd479266c..6abd5ba6a 100644
--- a/src/auth/callback-page.test.ts
+++ b/src/auth/callback-page.test.ts
@@ -1,13 +1,19 @@
import { describe, expect, test } from "bun:test";
import {
- PRODUCT_GITHUB_LABEL,
- PRODUCT_GITHUB_URL,
- PRODUCT_SITE_LABEL,
- PRODUCT_SITE_URL,
-} from "../branding.js";
-import { callbackPageHtml, humanizeIdentifier } from "./callback-page.js";
-import { authorizationDoneHtml } from "./oauth/callback-server.js";
+ authorizationDoneHtml,
+ callbackPageHtml,
+ humanizeIdentifier,
+ type CallbackPageCopy,
+} from "./callback-page.js";
+
+const copy: CallbackPageCopy = {
+ productName: "Fixture Product",
+ siteUrl: "https://fixture.example",
+ siteLabel: "fixture.example",
+ githubUrl: "https://github.com/fixture",
+ githubLabel: "github.com/fixture",
+};
describe("humanizeIdentifier", () => {
test("machine identifiers lose their separators and lead with a capital", () => {
@@ -24,59 +30,57 @@ describe("humanizeIdentifier", () => {
describe("callbackPageHtml", () => {
test("success names the server that connected", () => {
- const html = callbackPageHtml({ subject: "linear" });
+ const html = callbackPageHtml({ subject: "linear" }, copy);
expect(html).toContain("Linear connected successfully");
expect(html).not.toContain("access_denied");
});
test("provider authorization waits for native setup before claiming connection", () => {
- const html = authorizationDoneHtml("Codex");
+ const html = authorizationDoneHtml("Codex", copy);
expect(html).toContain("Codex authorization received");
expect(html).toContain("finish setup");
expect(html).not.toContain("connected successfully");
});
test("failure names the server and the humanized reason", () => {
- const html = callbackPageHtml({
- subject: "granola",
- error: "access_denied",
- });
+ const html = callbackPageHtml(
+ {
+ subject: "granola",
+ error: "access_denied",
+ },
+ copy,
+ );
expect(html).toContain("Granola failed to connect");
expect(html).toContain("Access denied.");
expect(html).not.toContain("access_denied");
});
test("an unnamed authorization still renders both outcomes", () => {
- expect(callbackPageHtml()).toContain("Authorization complete");
- expect(callbackPageHtml({ error: "server_error" })).toContain(
+ expect(callbackPageHtml({}, copy)).toContain("Authorization complete");
+ expect(callbackPageHtml({ error: "server_error" }, copy)).toContain(
"Authorization did not complete",
);
});
test("the subject is escaped rather than pasted into markup", () => {
- expect(callbackPageHtml({ subject: "" })).not.toContain(
- "" }, copy),
+ ).not.toContain("`,
"