Skip to content

fix(cli): default logicsrc login to logicsrc.com - #104

Merged
ralyodio merged 1 commit into
masterfrom
fix/login-default-logicsrc-com
Jul 30, 2026
Merged

fix(cli): default logicsrc login to logicsrc.com#104
ralyodio merged 1 commit into
masterfrom
fix/login-default-logicsrc-com

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

logicsrc login defaulted to the generated Railway hostname
https://logicsrc-credentials-production.up.railway.app, which leaked deployment
infrastructure into every login prompt and every stored identity. This points it at
https://logicsrc.com.

-export const DEFAULT_API_URL = "https://logicsrc-credentials-production.up.railway.app";
+export const DEFAULT_API_URL = "https://logicsrc.com";

⚠️ Blocked on a DNS/Railway change — do not merge until it's done

logicsrc.com does not currently serve the CLI routes. Measured just now:

path logicsrc.com …up.railway.app
/cli/device/code 404 200
/cli/authorize 404
/healthz 404 200

The apex serves apps/logicsrc-web (the marketing site). The login routes live in
apps/pwa/src/routes/cli.mjs/cli/device/code, /cli/device/token,
/cli/authorize, /cli/token, /api/me.

So merging this as-is breaks logicsrc login for everyone until the pwa service is
reachable at logicsrc.com. Either:

  1. attach logicsrc.com (or a subdomain, and change this constant to match) to the pwa
    Railway service, or
  2. mount the pwa's /cli/* routes into the app serving the apex.

$LOGICSRC_API still overrides the default, so it remains a workaround either way.

Opened as a draft deliberately for that reason.

History

The Railway URL was not arbitrary — it came from cf475f0 (Jul 28), which fixed the
default from http://localhost:4010. This change supersedes that once the domain is
in place.

🤖 Generated with Claude Code

The default API origin was the generated Railway hostname
(logicsrc-credentials-production.up.railway.app), which leaked deployment
infrastructure into every login prompt and stored identity. Point it at the
production domain instead.

NOTE: logicsrc.com does not currently serve the credentials app's CLI routes —
/cli/device/code, /cli/device/token, /cli/authorize, /cli/token, and /api/me
live in apps/pwa (src/routes/cli.mjs), while the apex serves apps/logicsrc-web.
At time of writing all of those return 404 on logicsrc.com and 200 on the
Railway origin, so login will fail until the apex (or a subdomain) is pointed
at the pwa service. $LOGICSRC_API overrides the default in the meantime.

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

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio
ralyodio marked this pull request as ready for review July 30, 2026 14:23
@ralyodio
ralyodio merged commit 0510d86 into master Jul 30, 2026
5 checks passed
ralyodio added a commit that referenced this pull request Jul 30, 2026
`logicsrc login` defaults to https://logicsrc.com (#104), but every path it
needs returns 404 there: the apex runs the marketing app, while /cli/* lives in
apps/pwa on its own service.

Proxy those paths from the app that owns the apex, the same way CommandBoard is
already proxied. No DNS record, no Railway custom domain, and no subdomain --
and it makes the CLI's existing default origin correct rather than requiring
another change to chase it.

Pointing the apex at the pwa instead was the obvious alternative and is wrong:
the pwa serves `/` too, so it would take the marketing site down with it.

Proxied:
  /cli/:path*            the device-code and loopback login flows
  /api/me                identity
  /api/credshare/:path*  the credential-sharing API used after login
  /auth/:path*           /cli/authorize and /cli/device are behind requireAuth,
                         so an unauthenticated visitor is redirected here; without
                         it the browser half of the flow dead-ends on a 404

Order matters and is asserted: CommandBoard owns a catch-all /api/:path*, so
/api/me and /api/credshare/* have to match first or CLI auth silently goes to
the wrong service.

Rewrite construction is factored into pure functions so the ordering is testable
without booting Next, and degrades cleanly: with CREDENTIALS_APP_URL unset the
output is byte-identical to what shipped before.

Requires CREDENTIALS_APP_URL on the logicsrc-web service, pointing at the
credentials app's origin.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ralyodio
ralyodio deleted the fix/login-default-logicsrc-com branch July 30, 2026 18:36
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