Skip to content

cli: Use the correct build command during deploys. - #41

Merged
cpojer merged 1 commit into
mainfrom
void-init-build
Mar 27, 2026
Merged

cpojer merged 1 commit into
mainfrom
void-init-build

Conversation

@cpojer

@cpojer cpojer commented Mar 27, 2026 •

Copy link
Copy Markdown
Member

This PR fixes two things:

  • A static app could only use vite build and did not support the inference build command.
  • When migrating an app, it would implicitly only use vite build instead of custom build scripts that might be defined. Now it checks and uses the package.json "build" script instead.

@cpojer
cpojer enabled auto-merge (squash) March 27, 2026 07:45
@Brooooooklyn
Brooooooklyn disabled auto-merge March 27, 2026 13:33
@cpojer cpojer changed the title cli: Ask which build command should be used during migrations. cli: Use the correct build command during deploys. Mar 27, 2026
@cpojer
cpojer merged commit 7d93e2a into main Mar 27, 2026
6 checks passed
@cpojer
cpojer deleted the void-init-build branch March 27, 2026 13:34
cpojer pushed a commit that referenced this pull request Sep 11, 2026
…dashboard (#41)

* fix(auth): set JWT as httpOnly cookie instead of URL query param for dashboard

The 30-day JWT was passed in the redirect URL query parameter, exposing
it in browser history, server/CDN logs, and Referer headers. For
dashboard redirects, the API now sets the token as an httpOnly cookie on
the shared domain via Set-Cookie on the 302 response. CLI (localhost)
redirects remain unchanged as they are already safe.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(auth): correct cookie domain derivation, logout, and local dev fallback

- Derive cookie domain from DASHBOARD_URL env var instead of naive
  .split(-2) on the redirect URL, which broke staging environments
  and multi-level TLDs
- Add matching domain to deleteCookie in logout and auth middleware
  so browsers actually clear the domain-scoped cookie
- Restore query param fallback in dashboard callback for local dev
  where localhost can't use domain cookies

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(auth): replace domain cookie with auth code exchange

The domain cookie approach (.void.cloud) leaked production tokens to
staging subdomains, breaking auth for users signed into both envs.
Also, the callback preferred stale cookies over fresh query param tokens.

Replace with a short-lived authorization code pattern:
- API stores JWT in KV with 60s TTL, redirects with ?code=<uuid>
- Dashboard callback exchanges code for JWT via POST /auth/exchange
- Dashboard sets a host-only cookie (no domain, no cross-env leakage)
- Logout and middleware revert to simple host-only deleteCookie
- CLI/local-dev path unchanged (token in query param on localhost)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(auth): store auth codes in PostgreSQL for consistency and atomicity

KV's eventual consistency meant the auth code written at one CF colo
might not be visible when the dashboard exchanged it from another colo,
causing intermittent login failures. The non-atomic KV get-then-delete
also allowed parallel replays of the same code.

Switch to PostgreSQL with atomic DELETE … RETURNING (same pattern as
the existing OAuth nonce flow). Also derive `secure` flag from the
request protocol instead of hardcoding false on the token fallback path.

- Add auth_codes table (migration 0008) and store/consume/purge helpers
- Wire purgeExpiredAuthCodes into the hourly cron alongside nonce purge
- Fix secure: false regression in callback.server.ts token fallback

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <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