fix(cli): redirect Console on a bare/reserved platform host to the cloud console#2355
Merged
Merged
Conversation
…oud console `objectstack serve`/`dev` serves the Console SPA on ANY host, but a bare/reserved platform host (the apex, or `www`/`app`/… — none bind a tenant env) has no env, so its `/api/v1/auth/*` calls 404 → the login renders the misleading "Auth request failed with status 404" dead form. The unknown-hostname guard already passed these reserved hosts straight through (RESERVED includes the empty/apex subdomain), so the SPA loaded and broke. Fix: in the guard, when a reserved/apex platform host receives a `/_console*` request AND the runtime is cloud-connected (`OS_CLOUD_URL` set), 302 it to the cloud control plane (`OS_CLOUD_URL` + `/_console/`), where the user picks/opens an environment. A self-hosted single-env runtime (no `OS_CLOUD_URL`) keeps the prior pass-through, and non-console paths (infra, health, /api) are unchanged. A real env host resolves to a tenant and is served normally. Mirrors the same cleanup on the cloud serve-node path (objectos `server/index.ts`), which was verified live: bare `/_console/login` → 302 → cloud console; `/api/v1/auth/*` still 404; env host /_console → 200. cli build green (DTS typecheck clean). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 15 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The "dead login face"
objectstack serve/devserves the Console SPA on any host, but a bare/reserved platform host (the apex, orwww/app/… — none bind a tenant env) has no env → its/api/v1/auth/*calls 404 → the login renders the misleading "Auth request failed with status 404" dead form. The unknown-hostname guard already passes reserved hosts through (RESERVEDincludes the empty/apex subdomain), so the SPA loads and breaks.Fix
In the guard, when a reserved/apex platform host gets a
/_console*request and the runtime is cloud-connected (OS_CLOUD_URLset), 302 it to the cloud control plane (OS_CLOUD_URL+/_console/). A self-hosted single-env runtime (noOS_CLOUD_URL) keeps the prior pass-through; non-console paths (infra, health,/api) are unchanged; a real env host resolves to a tenant and is served normally.Verification
Mirrors the same cleanup on the cloud
serve-nodepath (objectosserver/index.ts), which was verified live: barelocalhost/_console/login→302→ cloud console;/api/v1/auth/*still404; env host/_console→200.@objectstack/clibuild green (DTS typecheck clean).Found while dogfooding the magic moment locally (
run-stack.sh --seedboots objectos viaobjectstack dev→ this guard). The cloud-side mirror is a separate cloud PR; a cloud.framework-shabump consumes this.🤖 Generated with Claude Code