Skip to content

fix(hoverclient): send token: null (not empty string) on signin auth.json#28

Merged
intel352 merged 2 commits into
mainfrom
fix/signin-token-null-2026-05-30T1900
May 30, 2026
Merged

fix(hoverclient): send token: null (not empty string) on signin auth.json#28
intel352 merged 2 commits into
mainfrom
fix/signin-token-null-2026-05-30T1900

Conversation

@intel352
Copy link
Copy Markdown
Contributor

Summary

Hover's React signin auth.json branches on the token field for its "magic token" sign-in. A non-null token (including empty string "") routes to magic-token validation, which fails an empty token with a generic "Invalid username or password." — even when username/password are correct. The plugin sent "token": ""; the browser sends token: null for password sign-in. Send null.

Root cause (live diagnosis)

  • Plugin auth.json: {username, password, remember:false, token:""} → 401 "Invalid username or password" with valid creds.
  • Browser auth.json (verified via DevTools Network on a successful login): {username, password, token: null} → succeeds, then auth2.json {code} for TOTP.
  • Cred-free elimination: cookieless probe → endpoint returns normal invalid-creds JSON (CSRF/session NOT required); username confirmed exact. null vs "" was the only remaining difference from the working browser request.

Test plan

  • go build ./... + go test ./pkg/hoverclient/ green (the existing test asserts the token key is present, which nil preserves → null in JSON).
  • Validation: a live wfctl infra import-all --provider hover (gocodealone-dns import workflow) after release + pin bump.

🤖 Generated with Claude Code

intel352 and others added 2 commits May 30, 2026 15:00
Hover's React signin added 'magic token' sign-in. auth.json branches on the
'token' field: a non-null value (including empty string "") routes to
magic-token validation, which fails an empty token with a generic
'Invalid username or password.' — even when username/password are correct.
The browser sends token: null for password sign-in (verified via DevTools
Network); the plugin was sending "". Send null to match.

Diagnosis: cookieless probe ruled out CSRF/session; username confirmed exact;
null vs "" was the only remaining difference vs the working browser request.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…en 401)

Strengthen TestClient_Login_UsesBrowserSigninShape: the token field must be
JSON null, not "". Was a key-presence check that passed for both. Proven:
fails with 'token must be JSON null, got ""' if the fix regresses to "".
@intel352 intel352 merged commit c3a0115 into main May 30, 2026
4 checks passed
@intel352 intel352 deleted the fix/signin-token-null-2026-05-30T1900 branch May 30, 2026 19:05
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