fix(cli): default logicsrc login to logicsrc.com

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>
This commit is contained in:
Anthony Ettinger 2026-07-30 14:19:23 +00:00
parent 2bed70971d
commit 1d200222ed

View file

@ -39,11 +39,16 @@ export function identityPath(): string {
} }
/** /**
* The hosted LogicSRC credentials app (`apps/pwa`) where `logicsrc login` * Where `logicsrc login` goes when nothing else is configured: the production
* goes when nothing else is configured. This is deliberately NOT logicsrc.com: * origin, not a generated Railway hostname.
* that origin serves the marketing site and has no /cli routes. *
* REQUIRES that logicsrc.com serve the credentials app's CLI routes
* (`/cli/device/code`, `/cli/device/token`, `/cli/authorize`, `/cli/token`,
* `/api/me` see apps/pwa/src/routes/cli.mjs). Until the apex is pointed at
* that service, login fails with a 404 on the first request; set $LOGICSRC_API
* to the deployment origin to work around it.
*/ */
export const DEFAULT_API_URL = "https://logicsrc-credentials-production.up.railway.app"; export const DEFAULT_API_URL = "https://logicsrc.com";
/** An explicitly configured API origin, if any. `LOGICSRC_API` is the documented one. */ /** An explicitly configured API origin, if any. `LOGICSRC_API` is the documented one. */
export function envApiUrl(): string | undefined { export function envApiUrl(): string | undefined {