From 78d0aaad0c797506bd50ab0bbb0d54da1a48fa37 Mon Sep 17 00:00:00 2001 From: metatroncubeswdev Date: Sat, 17 Oct 2026 21:28:49 -0400 Subject: [PATCH 1/3] Fix hardcoded "OpenSEO" app name in transactional emails Verification, invitation, and password-reset emails always said "OpenSEO" regardless of which product/brand is actually deployed. Co-Authored-By: Claude Sonnet 5 --- src/server/email/loops.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/email/loops.ts b/src/server/email/loops.ts index 39afaa2..203977c 100644 --- a/src/server/email/loops.ts +++ b/src/server/email/loops.ts @@ -122,7 +122,7 @@ export async function sendHostedVerificationEmail({ email, transactionalId: config.verificationTemplateId, dataVariables: { - appName: "OpenSEO", + appName: "CrawlerX", confirmationUrl, }, }); @@ -150,7 +150,7 @@ export async function sendHostedInvitationEmail({ email, transactionalId: templateId, dataVariables: { - appName: "OpenSEO", + appName: "CrawlerX", inviteUrl, organizationName, inviterName, @@ -172,7 +172,7 @@ export async function sendHostedPasswordResetEmail({ email, transactionalId: config.passwordResetTemplateId, dataVariables: { - appName: "OpenSEO", + appName: "CrawlerX", resetUrl, }, }); From 9298f67c7f80c4df0d53d4dddb400def48df5f1c Mon Sep 17 00:00:00 2001 From: metatroncubeswdev Date: Sat, 17 Oct 2026 21:31:30 -0400 Subject: [PATCH 2/3] Stop Autumn-only code paths throwing in local-ledger billing mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two call sites still hard-required AUTUMN_SECRET_KEY regardless of billing mode: the /api/autumn/$ route (autumn-js's client-side hooks hit it after sign-up/on billing screens) and getBillingUsageEvents (Autumn's per-event usage history). Both now degrade gracefully — 404 and an empty list, respectively — when Autumn isn't configured, the same way subscription.ts's credit checks already do, instead of autumn-js throwing "secret key not found" once a request actually reaches it. Co-Authored-By: Claude Sonnet 5 --- src/routes/api/autumn/$.ts | 8 +++++++- src/serverFunctions/billing.ts | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/routes/api/autumn/$.ts b/src/routes/api/autumn/$.ts index ebb58b5..60adbc6 100644 --- a/src/routes/api/autumn/$.ts +++ b/src/routes/api/autumn/$.ts @@ -53,7 +53,13 @@ function loadHandler() { } async function handleAutumnRequest(request: Request) { - if (!isHostedAuthMode(env.AUTH_MODE)) { + // 404 in non-hosted modes, and also in hosted mode when Autumn isn't + // configured — a direct-Stripe deployment runs the local-ledger billing + // fallback instead (see subscription.ts) and has no Autumn customer to + // read, so this route has nothing to serve. Checking here, before + // loadHandler(), avoids autumn-js throwing "secret key not found" deep + // inside the handler once a client request reaches it. + if (!isHostedAuthMode(env.AUTH_MODE) || !env.AUTUMN_SECRET_KEY?.trim()) { return new Response("Not found", { status: 404, }); diff --git a/src/serverFunctions/billing.ts b/src/serverFunctions/billing.ts index 1b5b212..2b43136 100644 --- a/src/serverFunctions/billing.ts +++ b/src/serverFunctions/billing.ts @@ -6,6 +6,7 @@ import { } from "@/shared/billing"; import { AppError } from "@/server/lib/errors"; import { + getOptionalEnvValue, getRequiredEnvValue, isHostedServerAuthMode, } from "@/server/lib/runtime-env"; @@ -61,6 +62,13 @@ export const getBillingUsageEvents = createServerFn({ method: "POST" }) return []; } + // No Autumn behind this deployment (local-ledger billing fallback, see + // subscription.ts) — there's no per-event usage history to page through, + // just the running total the ledger keeps. + if (!(await getOptionalEnvValue("AUTUMN_SECRET_KEY"))) { + return []; + } + const events: BillingUsageEvent[] = []; let offset = 0; From 336db032a44072819697b40f32e89e9f3ce3f990 Mon Sep 17 00:00:00 2001 From: metatroncubeswdev Date: Sun, 18 Oct 2026 01:36:42 -0400 Subject: [PATCH 3/3] Return JSON, not plain text, from the Autumn route's 404 autumn-js's client hooks call response.json() on every response regardless of status. The plain-text "Not found" body from the previous commit's guard made that throw a SyntaxError client-side ("Unexpected token 'N'...") in hosted mode once Autumn-dependent UI actually mounted and called it. Co-Authored-By: Claude Sonnet 5 --- src/routes/api/autumn/$.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/routes/api/autumn/$.ts b/src/routes/api/autumn/$.ts index 60adbc6..fb95f52 100644 --- a/src/routes/api/autumn/$.ts +++ b/src/routes/api/autumn/$.ts @@ -60,9 +60,13 @@ async function handleAutumnRequest(request: Request) { // loadHandler(), avoids autumn-js throwing "secret key not found" deep // inside the handler once a client request reaches it. if (!isHostedAuthMode(env.AUTH_MODE) || !env.AUTUMN_SECRET_KEY?.trim()) { - return new Response("Not found", { - status: 404, - }); + // JSON, not a plain-text body: the client-side autumn-js hooks call + // response.json() on every response regardless of status, and a + // non-JSON body throws a SyntaxError there instead of handling the 404. + return Response.json( + { message: "Not found", code: "not_found" }, + { status: 404 }, + ); } let context;