Skip to content

feat(cli): brand the auth login loopback pages (#1286) - #1288

Closed
nc9 wants to merge 5 commits into
mainfrom
feat/login-page-brand-1286
Closed

nc9 wants to merge 5 commits into
mainfrom
feat/login-page-brand-1286

Conversation

@nc9

@nc9 nc9 commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Closes #1286.

The page squirrel auth login shows after sign-in was a white card with a green heading. It now carries the squirrelscan brand.

What changed

  • New apps/cli/src/controllers/auth/callback-page.ts: one shell for every loopback page (inline pixel squirrel mark on a cream tile, lowercase wordmark, design-system cream and muted green, monospace brand stack with system fallbacks, subtle pixel grid). Light and dark via prefers-color-scheme, phone width, focus-visible outlines, reduced motion.
  • Success page: "You're in", the escaped email, "you can close this window", and the agent setup block (prompt as plain selectable text, copy button, setup link, aria-live status) restyled. Ids, script and behaviour are unchanged.
  • Expired, already-used and waiting pages use the same shell (status codes unchanged; the waiting page still reloads itself every second). There is no separate "denied" response in the loopback server; these are the four it serves.
  • Self-contained: nothing is fetched. A Content-Security-Policy meta (default-src 'none', style-src 'unsafe-inline', img-src data:, base-uri 'none', form-action 'none') allows the one inline script only by its sha256 hash (computed from the exact script constant the tests drive), and script-src 'none' on pages without a script. Only the escaped email is interpolated; escapeHtml now also escapes '.
  • Contrast checked at AA or better in both themes (text 13:1+, muted text 6.5:1+, button 5.3:1 light and 8.8:1 dark, links 5.2:1+).
  • Copy: lowercase product name, sentence-case headings, no em-dashes (tests assert it). docs/cli/auth.mdx and CHANGELOG (### Changed under ## [Unreleased]) updated.

Tests

apps/cli/tests/controllers/auth-login.test.ts: per page (success, expired, consumed, pending): shell, viewport and dark scheme present, nothing loads (no link, src, img, import, url(, only the setup URLs and the SVG namespace), the CSP and its script hash, copy rules; plus a hostile email (</strong><script>, <img onerror>, quotes) that injects nothing, "the email is the only interpolated value", and the reload only on the waiting page. The existing copy-prompt behaviour tests pass unchanged; the two heading assertions changed to the new sentence-case copy.

Local gates

tsgo, lint, format:check, docs make validate, the auth-login test file by path. Screenshots (light, dark, phone, all four pages) are rendered from the real function output with headless Chrome; they are in the lane scratchpad and listed in the lead's report, since images cannot be attached from the CLI.

One squirrelscan shell for the success, expired, already-used and waiting pages: inline mark and wordmark, brand palette and type with system fallbacks, light and dark, phone width, AA contrast. A CSP meta allows nothing to load and runs only the page's own copy script by hash. Only the escaped email is interpolated.

Signed-off-by: Nik Cubrilovic <[email protected]>
nc9 added 2 commits October 30, 2026 10:05
…ish the pages (#1286)

Content-Type with charset, a CSP header with frame-ancestors none, X-Frame-Options DENY, nosniff, no-referrer and no-store on 200, 410, 404 and 500, plus a referrer meta. Darker mascot tile in dark mode, balanced headings, link styled as the button's sibling, a pixel glyph per state, design-system grid. Tests hash the emitted script and assert each header over real HTTP.

Signed-off-by: Nik Cubrilovic <[email protected]>
@nc9 nc9 mentioned this pull request Oct 30, 2026
@nc9

nc9 commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Landed in v0.0.143 as 152e3386 cbf54c0c ec8d7318 75a45baa 1f9530b9 via #1341. Release: https://github.com/squirrelscan/squirrelscan/releases/tag/v0.0.143. Closing this original.

nik

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.

cli: the post-login loopback page is unbranded; make it squirrelscan branded

2 participants