fix(hoverclient): send token: null (not empty string) on signin auth.json#28
Merged
Merged
Conversation
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 "".
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.
Summary
Hover's React signin
auth.jsonbranches on thetokenfield 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 sendstoken: nullfor password sign-in. Sendnull.Root cause (live diagnosis)
{username, password, remember:false, token:""}→ 401 "Invalid username or password" with valid creds.{username, password, token: null}→ succeeds, thenauth2.json {code}for TOTP.nullvs""was the only remaining difference from the working browser request.Test plan
go build ./...+go test ./pkg/hoverclient/green (the existing test asserts thetokenkey is present, whichnilpreserves →nullin JSON).wfctl infra import-all --provider hover(gocodealone-dns import workflow) after release + pin bump.🤖 Generated with Claude Code