Skip to content

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

Merged
ralyodio merged 1 commit into
masterfrom
fix/cli-default-app-subdomain
Jul 30, 2026
Merged

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

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

The CLI defaulted to the apex, which runs the marketing app — so every path it needs
404s there. This points it at the host that actually serves them.

-export const DEFAULT_API_URL = "https://logicsrc.com";
+export const DEFAULT_API_URL = "https://app.logicsrc.com";

Verified live

app.logicsrc.com is now a custom domain on the credentials service with a valid cert
(CN=app.logicsrc.com), and the flow genuinely works:

POST /cli/device/code  ->  200   user_code: CMBY-M3WP
GET  /api/me           ->  401   (correct for unauthenticated — routing works)

vs logicsrc.com/cli/device/code -> 404.

Relationship to #106

#106 makes the apex forward these paths, which also works — but it needs logicsrc-web
deployed with CREDENTIALS_APP_URL set to be true. This needs nothing beyond the domain
that already exists. The rewrites remain useful as a convenience; they're just no longer
load-bearing.

$LOGICSRC_API still overrides, unchanged.

⚠️ Separately: the pwa needs a redeploy

The device flow currently returns:

verification_uri: https://logicsrc-credentials-production.up.railway.app/cli/device

That's #105 (make the URL follow the calling host) — merged but not deployed. Until the
pwa service redeploys, logicsrc login --device will still print the raw Railway hostname
even after this change lands. Nothing in this PR can fix that; it needs a deploy.

🤖 Generated with Claude Code

The default was the apex, which runs the marketing app -- so every path the CLI
needs (/cli/device/code, /cli/device/token, /cli/authorize, /cli/token,
/api/me) returns 404 there. Point it at the host that actually serves them.

app.logicsrc.com is now a custom domain on the credentials service with a valid
certificate, verified live: /cli/device/code returns 200 and issues a real user
code, /api/me returns 401 rather than 404, which is routing working correctly
for an unauthenticated request.

The apex can forward these paths instead -- that is what the rewrites in
apps/logicsrc-web/next.config.ts do -- but that needs a second service deployed
to be true, while this needs nothing beyond the domain that already exists. The
rewrites stay useful as a convenience; they are no longer load-bearing.

$LOGICSRC_API still overrides, unchanged.

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 merged commit 7c9796a into master Jul 30, 2026
5 checks passed
@ralyodio
ralyodio deleted the fix/cli-default-app-subdomain branch July 30, 2026 18:07
ralyodio added a commit that referenced this pull request Jul 30, 2026
The "Connect the CLI" card handed out:

    LOGICSRC_API=https://app.logicsrc.com logicsrc login
    logicsrc teams push <team> prod --env .env
    logicsrc teams pull <team> prod --env .env

Two things are wrong with that, and both survived a release.

Since #109 addressed vaults as <team> <project> <env>, push and pull take
three positionals. The hint passes two, so pasting it exits with a missing-
argument error -- the card is not merely stale, it is broken.

The LOGICSRC_API prefix sets the variable to the value the CLI already
defaults to (DEFAULT_API_URL, #107), so on the hosted app it does nothing
while reading like a required step. It is now emitted only when the origin
is not the default, which is the case it exists for: self-hosting.

`--env .env` is dropped for the same reason -- it restates the option's own
default, and sitting next to the new <env> positional it made one flag and
one argument look like the same thing.

Same stale two-argument form fixed in the post-install hint (install.sh) and
the accept-invite message, and in the empty-vault-list prompt on the card.

CLI_HINT moves to src/lib/cli-hint.mjs so a test can assert on the rendered
commands without standing up express and the database, matching how the
other lib-level views are covered. The tests pin the argument count rather
than the prose: restyling the card stays free, dropping an argument does not.

apps/pwa: 13/13 pass.

Co-Authored-By: Claude Opus 5 <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