Skip to content

fix(bootstrap-admin): target the app API, not the login profile's auth server#75

Merged
Bccorb merged 2 commits into
mainfrom
fix/bootstrap-admin-api-url
Jul 25, 2026
Merged

fix(bootstrap-admin): target the app API, not the login profile's auth server#75
Bccorb merged 2 commits into
mainfrom
fix/bootstrap-admin-api-url

Conversation

@Bccorb

@Bccorb Bccorb commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Problem

seamless bootstrap-admin and seamless login need different base URLs, and the CLI conflated them:

  • The bootstrap invite route /auth/internal/bootstrap/admin-invite and its delivery are exposed by the app API (the SeamlessAuth server adapter), which proxies /auth → the auth server's /internal/.... The auth server does not serve /auth/internal/... (it 404s).
  • login and every admin command (whoami, sessions, config, users, org) hit the profile's instanceUrl directly, and those routes (/login, /otp/*, /admin/*, /sessions, /system-config/*) live on the auth server.

bootstrap-admin resolved its target as SEAMLESS_API_URL → profile.instanceUrl → localhost:3000. So once you set the auth-server profile that login requires, bootstrap-admin fell through to it and every invite request 404'd.

Fix

Resolve bootstrap-admin's target independently of any login profile — it's inherently the app API adapter:

--api-url <url>  →  SEAMLESS_API_URL  →  http://localhost:3000
  • Adds --api-url <url>.
  • Removes --profile from this command (it no longer affects the target; the bootstrap secret is still auto-resolved from the local project — .env, auth/.env, docker-compose.yml).

This is safe because bootstrap-admin is a local-stack tool (it authenticates with the shared SEAMLESS_BOOTSTRAP_SECRET; managed instances bootstrap via the portal), so the auth-server-profile fallback only ever broke the local case.

Testing

tsc, eslint, build clean; 588 vitest tests pass (bootstrapAdmin.ts at 100% coverage). The API-URL-resolution suite now covers --api-url, SEAMLESS_API_URL, the default, and precedence.

Independent of the console-hosting PR (#74); branches off main.

Bccorb added 2 commits July 24, 2026 22:32
…h server

The bootstrap invite route and its delivery are exposed by the app API adapter,
not the auth server. bootstrap-admin previously fell back to the active profile's
instanceUrl, so once a profile pointed at the auth server (as login and admin
commands require) bootstrap 404'd. Resolve the target independently:
--api-url -> SEAMLESS_API_URL -> http://localhost:3000. Remove --profile from the
command.
The auth server default (passkey,magic_link) has no method the CLI can drive
without a browser authenticator, so seamless login could not sign in to a fresh
scaffold. buildAuthEnv now appends email_otp to LOGIN_METHODS (composing with the
oauth method when providers are configured).
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