From a402475340648aaca1918bdcc453333169032ceb Mon Sep 17 00:00:00 2001 From: Mehar Khanna Date: Fri, 13 Nov 2026 10:42:18 -0500 Subject: [PATCH 1/5] Sign-in can return to the page check: safeNext allows /scan and /scan?url= genclass.dev/scan now opens the whole report to any signed-in account (the owner's call, 2026-11-13, genclass-site PR on deploy/scan-page-light). Its "Sign in to see it all" and "Create a free account" buttons go to /login and /signup with ?next=/scan?url=. safeNext refused that, so people landed on /account instead of back on the report. It now also allows /scan, or /scan?url= followed by up to 280 URL-safe characters (no &, #, quotes or angle brackets); every other next is refused as before. Tests: telemetry-worker 873 of 873; strict typecheck clean. Co-Authored-By: Claude Opus 5.5 --- telemetry-worker/src/auth.ts | 7 ++++++- telemetry-worker/test/auth.test.ts | 9 ++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/telemetry-worker/src/auth.ts b/telemetry-worker/src/auth.ts index a6ed82ae..b341bb7f 100644 --- a/telemetry-worker/src/auth.ts +++ b/telemetry-worker/src/auth.ts @@ -265,9 +265,14 @@ export function cleanEmail(v: unknown): string | null { } /** Only same-site paths under /account (a team invite link, /account/join/, is one) or /login/device may be a `next` target. */ +/** + * Where a sign-in may send the browser afterwards (?next=): our own account pages, the device page the genclass command + * opens, and the page check (/scan, or /scan?url=, so "Sign in to see it all" on a report comes + * back to that report). Anything else is null (the caller goes to /account). + */ export function safeNext(v: string | null | undefined): string | null { if (!v || v.length > 300 || !v.startsWith("/") || v.startsWith("//") || /[\\\u0000-\u001f]/.test(v)) return null; - return /^\/(account(\/[A-Za-z0-9/]*)?([?#].*)?|login\/device(\?code=[A-Za-z-]{0,12})?)$/.test(v) ? v : null; + return /^\/(account(\/[A-Za-z0-9/]*)?([?#].*)?|login\/device(\?code=[A-Za-z-]{0,12})?|scan(\?url=[A-Za-z0-9%._~!*'()\/:+-]{1,280})?)$/.test(v) ? v : null; } export function fail(status: number, error: string, headers: Record = {}): Response { diff --git a/telemetry-worker/test/auth.test.ts b/telemetry-worker/test/auth.test.ts index 661335e9..4f3efb7c 100644 --- a/telemetry-worker/test/auth.test.ts +++ b/telemetry-worker/test/auth.test.ts @@ -1385,9 +1385,12 @@ describe("accounts: CBOR, signatures, links (unit)", () => { expect(() => derToRaw(Uint8Array.from([0x31, 0x00]))).toThrow(); }); - it("next targets stay on our own account pages; dashboard links parse", () => { - for (const ok of ["/account", "/account/apps/0123456789abcdef", "/login/device?code=BCDF-GHJK", "/account?welcome=1"]) expect(safeNext(ok)).toBe(ok); - for (const bad of ["//evil.example", "/\\evil.example", "https://evil.example", "/start", "/account/../x", "/login/device?code=", null]) expect(safeNext(bad as string)).toBeNull(); + it("next targets stay on our own account pages and the page check; dashboard links parse", () => { + for (const ok of ["/account", "/account/apps/0123456789abcdef", "/login/device?code=BCDF-GHJK", "/account?welcome=1", + "/scan", "/scan?url=https%3A%2F%2Fshop.example.com%2Fpricing%3Fa%3D1", "/scan?url=stripe.com/pricing"]) expect(safeNext(ok)).toBe(ok); + for (const bad of ["//evil.example", "/\\evil.example", "https://evil.example", "/start", "/account/../x", "/login/device?code=", null, + "/scanner", "/scan/../account", "/scan?url=", "/scan?url=", '/scan?url=a"b', "/scan?url=a&next=//evil.example", "/scan?url=a#x", "/scan?other=1", + "/scan?url=" + "a".repeat(281)]) expect(safeNext(bad as string)).toBeNull(); const s = "A".repeat(32); expect(secretFromLink(`https://genclass.dev/dashboard/${s}`)).toBe(s); expect(secretFromLink(` /dashboard/${s} `)).toBe(s); From 8754d72ae831a39f97f8984885c8b15f5c37b95b Mon Sep 17 00:00:00 2001 From: Mehar Khanna Date: Sun, 15 Nov 2026 18:18:38 -0500 Subject: [PATCH 2/5] Collector: GET /api/billing/pro for the page check, and Pro's checkout comes back to the report The page check now shows the score and the whole report to Pro only (genclass-site, scan-worker). It asks GET /api/billing/pro with a browser's cookie or the genclass command's token: { pro, via, trial_days }, the same answer as the command's own gate (own plan, trial, grant, a paying team's seat; open where nothing is sold). "Start 3 days free" on a report opens /account/billing?plan=pro&start=1&next=/scan?url=...: the next survives the sign-in, rides on Stripe's success address (and is the cancel address), and the plan page goes back to the report once the payment shows; an account that has Pro goes straight back. Only /scan paths are taken (scanNext, on top of safeNext from #234). Co-Authored-By: Claude Opus 5.5 --- telemetry-worker/src/billing-pages.ts | 9 +- telemetry-worker/src/billing.ts | 54 ++++++++++-- telemetry-worker/src/stripe.ts | 14 ++-- telemetry-worker/test/scan-pro.test.ts | 111 +++++++++++++++++++++++++ 4 files changed, 175 insertions(+), 13 deletions(-) create mode 100644 telemetry-worker/test/scan-pro.test.ts diff --git a/telemetry-worker/src/billing-pages.ts b/telemetry-worker/src/billing-pages.ts index 8083ec5c..74592c1c 100644 --- a/telemetry-worker/src/billing-pages.ts +++ b/telemetry-worker/src/billing-pages.ts @@ -74,6 +74,8 @@ export interface BillingView { go?: boolean; /** Back from a switch's Checkout (?to=): the plan it bought. */ switchTo?: string | null; + /** Started from a page check (?next=/scan?url=..., billing.ts scanNext): the checkout and this page go back there after. */ + next?: string | null; /** The names of the plans sold through Stripe Managed Payments (src/stripe.ts managedPayments). */ managedPlans?: string[]; /** The account's team as its owner sees it (src/team.ts teamOf); left out, the page has no Team section. */ @@ -528,7 +530,7 @@ ${ ${projectsSection(v)} ${teamSection(v)} -`; +`; const script = ` (function(){ @@ -538,6 +540,7 @@ ${teamSection(v)} b.addEventListener("click", function(){ var err = document.getElementById("planerr"); err.textContent = ""; var body = { plan: b.getAttribute("data-plan") }, seats = document.querySelector('[data-seats="' + body.plan + '"]'); + if (cfg.next) body.next = cfg.next; if (seats) { var n = Number(seats.value); if (!(n >= 1 && n <= ${MAX_SEATS} && Math.floor(n) === n)) { err.textContent = "Seats is a whole number from 1 to ${MAX_SEATS}. For a larger team, email ${esc(CONTACT)}."; return; } @@ -580,6 +583,8 @@ ${teamSection(v)} gcBusy(portal, true, "Opening Stripe..."); gcPost("/api/billing/portal", {}).then(function(j){ location.href = j.url; }, function(e){ err.textContent = gcWhy(e); gcBusy(portal, false); }); }); + // back from a checkout started on a page check, the plan already showing: the report, which now opens with Pro + if (cfg.next && cfg.done && !cfg.want) { location.replace(cfg.next); return; } if (cfg.want) { var tries = 0; var timer = setInterval(function(){ @@ -587,7 +592,7 @@ ${teamSection(v)} fetch("/api/billing", { headers: { accept: "application/json" }, cache: "no-store", credentials: "same-origin" }) .then(function(r){ return r.ok ? r.json() : null; }) .then(function(j){ - if (j && j.plan && (cfg.want === "paid" ? j.plan !== "free" : j.plan === cfg.want)) { clearInterval(timer); location.reload(); } + if (j && j.plan && (cfg.want === "paid" ? j.plan !== "free" : j.plan === cfg.want)) { clearInterval(timer); if (cfg.next) location.replace(cfg.next); else location.reload(); } }) .catch(function(){}); }, 3000); diff --git a/telemetry-worker/src/billing.ts b/telemetry-worker/src/billing.ts index fcfcf0cd..2b20cddc 100644 --- a/telemetry-worker/src/billing.ts +++ b/telemetry-worker/src/billing.ts @@ -24,7 +24,7 @@ // server (checkout, portal, Send test, new export keys) take AUTH_LIMIT's budget per account, and the export // EXPORT_LIMIT's. -import { accountContext, accountProjects, authenticate, csrfFail, fail, originOk, ownedProject, page, readJson, redirect, webSession, type Auth, type C } from "./auth.js"; +import { accountContext, accountProjects, authenticate, csrfFail, fail, originOk, ownedProject, page, readJson, redirect, safeNext, webSession, type Auth, type C } from "./auth.js"; import { billingPage, projectPlanPage } from "./billing-pages.js"; import { liveFixUsage } from "./usage.js"; import type { Env, HandleOptions, RateLimiterLike } from "./collector.js"; @@ -73,7 +73,7 @@ import { stripeWebhook, subscriptionState, } from "./stripe.js"; -import { membershipsOf, teamOf } from "./team.js"; +import { activeOwners, membershipsOf, teamOf } from "./team.js"; import { b64url } from "./webauthn.js"; type Fetch = (input: string, init?: RequestInit) => Promise; @@ -83,6 +83,40 @@ const MAX_EXPORT_KEYS = 10; const DAY = 86_400_000; const method = (): Response => fail(405, "method not allowed"); + +/** A `next` that Pro's checkout may come back to: the page check only (/scan, /scan?url=...), as safeNext allows it. */ +export function scanNext(v: string | null | undefined): string | null { + const n = safeNext(v); + return n && /^\/scan(\?|$)/.test(n) ? n : null; +} + +/** + * How the account has Pro: "plan" (its own plan, its trial, GenClass's grant), "team" (an active place in a team that + * has one), "open" (nothing is sold to it here: no paid plan, no Stripe key, a test key and an account not on its + * list, PLAN_GATES open), or null (Free). The same answer as the genclass command's (cli.ts cliVia), for both kinds + * of sign-in. + */ +export async function proVia(c: C, account: Auth["account"]): Promise<"plan" | "team" | "open" | null> { + if (!PAID_PLANS.length || !canBuy(c.env, account)) return "open"; + const own = await accountAccess(c.db, account.id, c.env, c.now); + if (own.source === "open") return "open"; + if (own.source !== null) return "plan"; + for (const owner of await activeOwners(c.db, c.env, account.id, c.now)) if ((await accountAccess(c.db, owner, c.env, c.now)).source !== null) return "team"; + return null; +} + +/** + * GET /api/billing/pro: whether the signed-in account has Pro (proVia), for a browser session or the genclass + * command's token, and the days free its first Pro would start with (null with Pro or with none left). The page check + * (genclass-scan, over its ACCOUNTS service binding) asks it for each report it shows, to decide what is locked. + */ +async function proAnswer(c: C): Promise { + const a = await authenticate(c); + if (!a) return fail(401, "not signed in"); + const via = await proVia(c, a.account); + const plan = PAID_PLANS[0]; + return json(200, { ok: true, pro: via !== null, via, trial_days: via === null && plan ? (await trialFor(c.db, a.account.id, plan)) || null : null }); +} /** The 403 for something the account's plan leaves out, naming the plans that include it. */ const upgrade = (c: C, what: Entitlement): Response => { const plans = PLANS.filter((p) => entitled(p, what)).map((p) => p.name); @@ -148,6 +182,8 @@ export async function routeBilling(request: Request, url: URL, path: string, env return m === "POST" ? checkout(c, f) : method(); case "/api/billing/portal": return m === "POST" ? portal(c, f) : method(); + case "/api/billing/pro": + return get ? proAnswer(c) : method(); case "/api/billing/trial": return m === "POST" ? fail(410, `a trial starts at Checkout, on an app's plan page: ${c.cfg.origin}/account/billing`) : method(); case "/account/trial": @@ -220,9 +256,13 @@ export async function routeBilling(request: Request, url: URL, path: string, env // ?start=1 with a plan: the person chose it a moment ago (in the genclass command's plan step), so the page // opens that plan's checkout itself instead of waiting for one more click const go = !!picked && url.searchParams.get("start") === "1"; + // ?next=/scan?url=...: started from a page check's "Start 3 days free"; Stripe and this page send the person back + const next = scanNext(url.searchParams.get("next")); const a = await webSession(c); - // the plan picked on the pricing page survives the sign-in - if (!a) return redirect(`/login?next=${encodeURIComponent(`/account/billing${picked ? `?plan=${planParam(picked)}${go ? "&start=1" : ""}` : ""}`)}`); + // the plan picked on the pricing page (and where to go after) survives the sign-in + if (!a) return redirect(`/login?next=${encodeURIComponent(`/account/billing${picked ? `?plan=${planParam(picked)}${go ? "&start=1" : ""}${next ? `&next=${encodeURIComponent(next)}` : ""}` : ""}`)}`); + // already on Pro (its own, a grant, a team's seat): no second checkout, straight back to the report + if (next && (await proVia(c, a.account)) !== null) return redirect(next); // a plan sold per project, picked on the pricing page or started from an older genclass command: the plan page // of the account's first app still on Free, where it is bought for that app if (picked?.per_project === true) { @@ -253,6 +293,7 @@ export async function routeBilling(request: Request, url: URL, path: string, env done: url.searchParams.get("done") === "1", picked: picked?.id ?? null, go, + next, switchTo: pickedPlan(url.searchParams.get("to"))?.id ?? null, managedPlans: PAID_PLANS.filter((p) => managedPayments(env, p)).map((p) => p.name), now: c.now, @@ -382,8 +423,9 @@ async function checkout(c: C, f: Fetch): Promise { if (n === null) return fail(400, `seats is a whole number from 1 to ${MAX_SEATS}; for a larger team email ${PLANS_FILE.contact}`); seats = n; } - // started from an app's plan page: Stripe returns there + // started from an app's plan page: Stripe returns there; from a page check (next): Stripe and the plan page return to it const backTo = typeof body.project_id === "string" && (await ownedProject(c, a.account.id, body.project_id))?.id ? body.project_id : undefined; + const next = backTo ? null : scanNext(typeof body.next === "string" ? body.next : null); if (await overBudget(c.env.AUTH_LIMIT, "checkout", a.account.id)) return tooMany(); // as stored: ensureCustomer decides what to do with a customer from the other Stripe mode const account = { id: a.account.id, email: a.account.email, ...(await accountBilling(c.db, a.account.id)) }; @@ -427,7 +469,7 @@ async function checkout(c: C, f: Fetch): Promise { } // the first subscription starts with the plan's trial (trialFor), once per account const trialDays = customer.fresh || first ? await trialFor(c.db, a.account.id, plan, 0) : 0; - const url = await checkoutSession(c.env, f, { account, customer: customer.id, plan, origin: c.cfg.origin, now: c.now, fresh: customer.fresh, seats, trialDays, backTo }); + const url = await checkoutSession(c.env, f, { account, customer: customer.id, plan, origin: c.cfg.origin, now: c.now, fresh: customer.fresh, seats, trialDays, backTo, ...(next ? { next } : {}) }); return json(200, { url, trial_days: trialDays || null }); } catch (e) { return stripeFail(e); diff --git a/telemetry-worker/src/stripe.ts b/telemetry-worker/src/stripe.ts index 8f52f0fd..55813658 100644 --- a/telemetry-worker/src/stripe.ts +++ b/telemetry-worker/src/stripe.ts @@ -404,7 +404,7 @@ export function managedPayments(env: Env, plan: Plan): boolean { export async function checkoutSession( env: Env, f: Fetch, - o: { account: BillingAccount; customer: string; plan: Plan; origin: string; now: Date; fresh?: boolean; switchFrom?: string; seats?: number; project?: { id: string }; trialDays?: number; backTo?: string }, + o: { account: BillingAccount; customer: string; plan: Plan; origin: string; now: Date; fresh?: boolean; switchFrom?: string; seats?: number; project?: { id: string }; trialDays?: number; backTo?: string; next?: string }, ): Promise { // free days only on a first subscription (the caller decides), never on a switch, and only what Stripe allows (1 to 730) const trialDays = !o.switchFrom && Number.isInteger(o.trialDays) && o.trialDays! >= 1 && o.trialDays! <= 730 ? o.trialDays! : 0; @@ -426,7 +426,8 @@ export async function checkoutSession( (x.metadata?.genclass_switch_from ?? undefined) === o.switchFrom && x.metadata?.genclass_trial !== "1" && (x.metadata?.genclass_trial_days ?? "0") === String(trialDays) && - (x.metadata?.genclass_seats ?? "1") === String(seats); + (x.metadata?.genclass_seats ?? "1") === String(seats) && + (x.metadata?.genclass_next ?? "") === (o.next ?? ""); if (same && typeof x.url === "string" && x.url.startsWith("https://")) return x.url; await stripe(env, f, "POST", `/v1/checkout/sessions/${encodeURIComponent(x.id)}/expire`, {}); closed.push(x.id); @@ -440,6 +441,9 @@ export async function checkoutSession( // a project's checkout (version 4), or the account's started from an app's plan page (backTo), returns to that page const backId = o.project?.id ?? o.backTo; const back = backId ? `${o.origin}/account/billing?project=${encodeURIComponent(backId)}` : `${o.origin}/account/billing`; + // started from a page check (billing.ts scanNext): the plan page waits for the payment, then goes back to the report; + // a cancel goes straight back to it + const next = !backId && o.next ? o.next : null; // a double click within the same minute gets the same session; after closing pages, a new key (the old session // under the plain key may be one of those just closed); a switch has its own const after = closed.length ? `-after-${(await sha256Hex(closed.join(","))).slice(0, 16)}` : ""; @@ -457,9 +461,9 @@ export async function checkoutSession( client_reference_id: o.account.id, line_items: [perSeat ? { price, quantity: seats, adjustable_quantity: { enabled: true, minimum: 1, maximum: MAX_SEATS } } : { price, quantity: 1 }], // back from a switch, the page waits for the new plan - success_url: backId ? `${back}&done=1` : `${o.origin}/account/billing?done=1${o.switchFrom ? `&to=${o.plan.id}` : ""}`, - cancel_url: back, - metadata: { ...mark, genclass_plan: o.plan.id, ...(perSeat ? { genclass_seats: String(seats) } : {}), ...(trialDays ? { genclass_trial_days: String(trialDays) } : {}) }, + success_url: backId ? `${back}&done=1` : `${o.origin}/account/billing?done=1${o.switchFrom ? `&to=${o.plan.id}` : ""}${next ? `&next=${encodeURIComponent(next)}` : ""}`, + cancel_url: next ? `${o.origin}${next}` : back, + metadata: { ...mark, genclass_plan: o.plan.id, ...(next ? { genclass_next: next } : {}), ...(perSeat ? { genclass_seats: String(seats) } : {}), ...(trialDays ? { genclass_trial_days: String(trialDays) } : {}) }, // a card (or another payment method) up front payment_method_collection: "always", // the "Add promotion code" field: codes made in the Stripe dashboard (Product catalog, Coupons) for GenClass's prices diff --git a/telemetry-worker/test/scan-pro.test.ts b/telemetry-worker/test/scan-pro.test.ts new file mode 100644 index 00000000..fc4edfc7 --- /dev/null +++ b/telemetry-worker/test/scan-pro.test.ts @@ -0,0 +1,111 @@ +// The page check's Pro (owner, 2026-11-15: the score is Pro's): GET /api/billing/pro, which the page check +// (genclass-scan, over a service binding) asks for each report with a browser's cookie or the genclass command's +// token; and the way back from Pro's checkout to the report (?next=/scan?url=..., billing.ts scanNext): the sign-in, +// the plan page, Stripe's success and cancel addresses, and the plan page once the payment shows. +import { beforeEach, describe, expect, it } from "vitest"; +import { scanNext } from "../src/billing.js"; +import { resetTokenCache } from "../src/dashboard.js"; +import { resetOwnerCache } from "../src/paid.js"; +import { resetStripeCache } from "../src/stripe.js"; +import { call, cliToken, fakeStripe, GENCLASS_PORTAL, resetClock, setPlan, setup, signedIn, WEBHOOK_SECRET } from "./account-helpers.js"; + +const LIVE = { STRIPE_SECRET_KEY: "sk_live_fake", STRIPE_WEBHOOK_SECRET: WEBHOOK_SECRET, STRIPE_PORTAL_CONFIGURATION: GENCLASS_PORTAL }; +type E = Parameters[0]; + +beforeEach(() => { + resetClock(); + resetTokenCache(); + resetOwnerCache(); + resetStripeCache(); +}); + +async function user(env: E, email = "ada@example.com") { + const me = await signedIn(env, email); + return { ...me, bearer: await cliToken(env, me.cookie) }; +} +const team = (sql: ReturnType["sql"], accountId: string, seats = 3) => + setPlan(sql, accountId, "team", { stripe_mode: "live", seats, subscription_id: "sub_t000000001", subscription_status: "active", current_period_end: "2026-12-13T12:00:00.000Z" }); +const pro = async (env: E, o: { cookie?: string; bearer?: string }) => { + const r = await call(env, "GET", "/api/billing/pro", { ...o, origin: null }); + return { status: r.status, body: (await r.json()) as Record }; +}; + +describe("GET /api/billing/pro: whether a sign-in has Pro, for the page check", () => { + it("answers for a browser session and the genclass command's token alike: Free with its trial, Pro, a grant, a team's seat", async () => { + const t = setup(LIVE); + expect((await pro(t.env, {})).status).toBe(401); + const me = await user(t.env); + const FREE = { ok: true, pro: false, via: null, trial_days: 3 }; + expect(await pro(t.env, { cookie: me.cookie })).toEqual({ status: 200, body: FREE }); + expect(await pro(t.env, { bearer: me.bearer })).toEqual({ status: 200, body: FREE }); + team(t.sql, me.account.id); + const PRO = { ok: true, pro: true, via: "plan", trial_days: null }; + expect(await pro(t.env, { cookie: me.cookie })).toEqual({ status: 200, body: PRO }); + expect(await pro(t.env, { bearer: me.bearer })).toEqual({ status: 200, body: PRO }); + // GenClass's grant + const g = await user(t.env, "grace@example.com"); + setPlan(t.sql, g.account.id, "free", { comp_until: "9999-12-31T00:00:00.000Z", comp_plan: "team" }); + expect((await pro(t.env, { cookie: g.cookie })).body).toMatchObject({ pro: true, via: "plan" }); + // a seat on a paying owner's team + const bob = await user(t.env, "bob@example.com"); + expect((await pro(t.env, { bearer: bob.bearer })).body).toMatchObject({ pro: false }); + const inv = (await (await call(t.env, "POST", "/api/team/invites", { body: {}, cookie: me.cookie })).json()) as { url: string }; + expect((await call(t.env, "POST", "/api/team/join", { body: { code: inv.url.split("/").pop() }, cookie: bob.cookie })).status).toBe(200); + expect((await pro(t.env, { bearer: bob.bearer })).body).toEqual({ ok: true, pro: true, via: "team", trial_days: null }); + expect((await call(t.env, "POST", "/api/billing/pro", { cookie: me.cookie })).status).toBe(405); + }); + it("is open where nothing is sold (no Stripe key), as the genclass command is", async () => { + const t = setup(); + const me = await user(t.env); + expect((await pro(t.env, { cookie: me.cookie })).body).toEqual({ ok: true, pro: true, via: "open", trial_days: null }); + }); +}); + +describe("back to the report after Pro's checkout (?next=)", () => { + const NEXT = "/scan?url=" + encodeURIComponent("https://shop.example.com/"); + it("takes only the page check as a way back", () => { + expect(scanNext(NEXT)).toBe(NEXT); + expect(scanNext("/scan")).toBe("/scan"); + for (const bad of ["/account", "//evil.example", "https://evil.example", "/scanner", "/scan?url=a&next=//evil.example", null]) expect(scanNext(bad)).toBeNull(); + }); + it("keeps it through the sign-in, sends a Pro account straight back, and puts it on Stripe's success and cancel addresses", async () => { + const t = setup(LIVE); + const start = `/account/billing?plan=pro&start=1&next=${encodeURIComponent(NEXT)}`; + const out = await call(t.env, "GET", start, { origin: null }); + expect(out.status).toBe(302); + const login = new URL(out.headers.get("location")!, "https://genclass.dev"); + expect(login.pathname).toBe("/login"); + expect(login.searchParams.get("next")).toBe(start); + const me = await signedIn(t.env); + // Free: the plan page opens the checkout itself, and its script knows where to go after + const page = await call(t.env, "GET", start, { cookie: me.cookie, origin: null }); + expect(page.status).toBe(200); + const html = await page.text(); + const cfg = JSON.parse(/