Skip to content

feat(web): config-gated Privacy and Terms links plus sign-in consent line - #1051

Merged
jiashuoz merged 1 commit into
mainfrom
feat/legal-links
Sep 27, 2026
Merged

jiashuoz merged 1 commit into
mainfrom
feat/legal-links

Conversation

@jiashuoz

Copy link
Copy Markdown
Member

What

Adds config-gated links to the hosted deployment's Terms of Service and Privacy Policy, which are currently linked nowhere on the e2a website or dashboard, plus a consent line on the sign-in flow.

  • web/src/lib/site.ts: PRIVACY_URL / TERMS_URL, resolved from NEXT_PUBLIC_PRIVACY_URL / NEXT_PUBLIC_TERMS_URL, following the same pattern as PRICING_PATH — empty by default, so self-host and staging builds are completely unaffected. Also adds isExternalURL() (decides target="_blank" based on origin vs SITE_URL) and legalFooterLinks() (the shared "Privacy"/"Terms" entry list, present only when configured).
  • Landing page footer (FOOTER_LINKS) appends Privacy/Terms when set. The blog, docs, and MCP page footers reuse the same legalFooterLinks() data via a small shared LegalFooterLinks component so all public footers stay consistent.
  • A shared SignInConsent component renders By signing in you agree to the Terms and Privacy policy. beneath the landing page nav's "Sign in" link and the dashboard's signed-out sign-in prompt ((app)/AppLayoutClient.tsx) — only when both URLs are configured; omitted entirely otherwise.
  • web/.env.example and docs/deployment.md document both new env vars.

Why

The hosted deployment (e2a.dev) has legal pages with no discoverable links anywhere on the site, and no consent language in the sign-in flow. This wires up config-gated surfacing without making self-host or staging deployments carry any legal-page assumptions.

Env vars

  • NEXT_PUBLIC_PRIVACY_URL — path or absolute URL to the Privacy Policy.
  • NEXT_PUBLIC_TERMS_URL — path or absolute URL to the Terms of Service.

Both accept a same-origin path (e.g. /privacy) or an absolute URL. Leaving either unset hides the corresponding footer link; the sign-in consent line only appears when both are set.

Follow-up

The hosted deployment's actual build args (setting these two env vars to the ops repo's /privacy and /terms routes) land in tokencanopy/e2a-ops separately, after this ships in a release.

Test plan

  • npm run lint — clean
  • npx tsc --noEmit — clean
  • npm test — 123 suites / 1053 tests passing
  • npm run build — static export succeeds

🤖 Generated with Claude Code

…line

The hosted deployment's terms of service and privacy policy pages are
currently linked nowhere on the site or dashboard, and the sign-in flow
shows no consent line. Add NEXT_PUBLIC_PRIVACY_URL / NEXT_PUBLIC_TERMS_URL
to lib/site.ts, following the PRICING_PATH pattern: empty by default so
self-host and staging builds are unaffected, populated by the hosted
deployment at image build time.

- Landing page footer, plus the blog/docs/mcp footers via a shared
  LegalFooterLinks helper, show "Privacy"/"Terms" only when configured.
- A shared SignInConsent component renders "By signing in you agree to
  the Terms and Privacy policy." beneath the landing page's Sign in link
  and the dashboard's signed-out sign-in prompt, only when both URLs are
  set.
- Links accept a same-origin path or an absolute URL; isExternalURL()
  decides target=_blank based on origin vs SITE_URL.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@jiashuoz
jiashuoz merged commit 5fbbd9c into main Sep 27, 2026
29 checks passed
@jiashuoz
jiashuoz deleted the feat/legal-links branch September 27, 2026 10:42
jiashuoz added a commit that referenced this pull request Sep 27, 2026
#1051 read NEXT_PUBLIC_PRIVACY_URL and NEXT_PUBLIC_TERMS_URL in site.ts
but never declared them in web/Dockerfile, so `docker build` dropped the
hosted deployment's values and 1.12.0 shipped without the footer links or
the consent line. Adds the ARG/ENV pair and a comment explaining why the
Dockerfile is the allowlist.

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant