Repository navigation
BUILD-43: Make account registration output conditional on acceptance - #58
Merged
Merged
Conversation
register and send-code exit 0 when the request is accepted, which does not guarantee that an email or code was sent. Their success output claimed both unconditionally, so a mistyped --email/--phone or an existing account left users waiting on something that never arrives. register and send-code now say a message or code is on its way only if the details match, and point existing customers at "band auth login" or a password reset. verify adds a hint when the API rejects the request with a 400, since a mistyped --email or --phone is reported the same way as a wrong code. README.md and AGENTS.md describe the new behavior, including guidance for agents on not reporting delivery as fact. Add testutil.FakeClient.PostErr and testutil.CaptureStderr so tests can cover failures and the stderr messages. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
matthewkmartin
requested review from
a team,
TroyArcher,
jsanmartin123 and
kylefirman
and removed request for
a team
November 3, 2026 14:21
matthewkmartin
marked this pull request as ready for review
November 3, 2026 14:23
jsanmartin123
approved these changes
Nov 3, 2026
brianluisgomez
approved these changes
Nov 3, 2026
kylefirman
approved these changes
Nov 3, 2026
mhamer-bw
approved these changes
Nov 3, 2026
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
band account registerandband account send-codeexit 0 when the API accepts the request, which doesn't guarantee that an email or verification code was actually sent. Their success output said both unconditionally, so a mistyped--email/--phone, an expired registration, or an existing account left users waiting on something that never arrives.register: the success output now says a registration link is on its way if the email can be used to create an account. It also points existing customers atband auth loginor a password reset, and step 2 of the next steps is conditional ("If this is a new account, check your email…").send-code: now says a code is on its way if a pending registration matches, with a short "No code?" hint (check--email/--phone, or re-runregister).verify: when the API rejects the request with a 400, prints a hint to check that--emailand--phonematch what was registered, since a mistyped value is reported the same way as a wrong code. No hint for other failures, and none on success.README.mdandAGENTS.mdsay that success output doesn't confirm delivery.AGENTS.mdtells agents to report a code or email as requested, never as sent, and what to try if the user says nothing arrived (including not looping onsend-code).testutil.FakeClient.PostErrandtestutil.CaptureStderrso the failure path and the stderr messages can be tested.No API contract or flag changes, and JSON/stdout output is untouched.
Testing
cmd/account/messages_test.gocovers the conditional wording forregisterandsend-code, and theverifyhint for a 400 (shown) versus a 500, a network error and success (not shown).go test ./...,go vet ./...andgofmtare clean.golangci-lintreports the same 4typecheckissues ininternal/testutil/golden.goon an untouchedmainlocally (it looks like the installed linter predates the module's Go version), so I'm relying on CI's lint for this PR.AI assistance
This PR was substantially written with Claude Code. It stays a draft until a human has reviewed it.
🤖 Generated with Claude Code