Skip to content

Clarify CLI login HTTP errors#5518

Merged
bfops merged 7 commits into
masterfrom
bot/login-http-error
Jul 10, 2026
Merged

Clarify CLI login HTTP errors#5518
bfops merged 7 commits into
masterfrom
bot/login-http-error

Conversation

@clockwork-labs-bot

@clockwork-labs-bot clockwork-labs-bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Description of Changes

Improve spacetime login error clarity when login/auth endpoints return a non-success HTTP status.

Previously, the CLI attempted to decode JSON immediately, so a bad --auth-host that returned HTML/plaintext produced a generic JSON decoding error like expected value at line 1 column 1. The login flow now calls error_for_status() before JSON decoding on the web-auth login token request, login status polling, and SpacetimeDB token exchange paths.

API and ABI breaking changes

None.

Expected complexity level and risk

  1. Low-risk CLI-only error handling change. Successful responses continue through the same JSON deserialization path.

Testing

  • cargo fmt --all --check
  • cargo check -p spacetimedb-cli
  • cargo test -p spacetimedb-cli --lib
  • Bad-host smoke test with temporary config: spacetime login --auth-host https://maincloud.staging.spacetimedb.com --no-browser

Comment thread crates/cli/src/subcommands/login.rs Outdated
Comment thread crates/cli/src/subcommands/login.rs Outdated
Signed-off-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Comment thread crates/cli/src/subcommands/login.rs Outdated
Signed-off-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Comment thread crates/cli/src/subcommands/login.rs Outdated
Signed-off-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Comment thread crates/cli/src/subcommands/login.rs Outdated
Signed-off-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Comment thread crates/cli/src/subcommands/login.rs Outdated
Signed-off-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Comment thread crates/cli/src/subcommands/login.rs Outdated
Signed-off-by: Zeke Foppa <196249+bfops@users.noreply.github.com>

@bfops bfops left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bfops bfops enabled auto-merge July 10, 2026 15:36
@bfops bfops added this pull request to the merge queue Jul 10, 2026
Merged via the queue into master with commit 266fca7 Jul 10, 2026
71 of 72 checks passed
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.

2 participants