fix(auth-bootstrap): stay up for a retry on wrong-account instead of exiting#892
Open
dmerrick wants to merge 1 commit into
Open
fix(auth-bootstrap): stay up for a retry on wrong-account instead of exiting#892dmerrick wants to merge 1 commit into
dmerrick wants to merge 1 commit into
Conversation
…exiting When the wrong Twitch account signs in, GenerateUserAccessToken returns ErrIdentityMismatch and no token is written — but the callback handler used to signal the done channel, which fataled the process. That terminated the job pod, dropped the kubectl port-forward, and let the bootstrap chain move on without a chance to correct it. Now the mismatch branch keeps the HTTP listener (and thus the port-forward) up: it renders the "wrong account" page, re-surfaces the authorize URL so the operator can sign out / use incognito and re-auth in place, and does NOT signal done. Only a matching identity writes the token and exits 0. The wait loop stays bounded by flowTimeout, so a never-corrected mismatch still terminates. Genuine non-recoverable errors still fail loudly via done. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
auth-bootstrapdetects the mismatch (mytwitch.ErrIdentityMismatch) and writes no token — but it used tolog.Fatalf, killing the job pod and dropping thekubectl port-forward, so the bootstrap chain moved on without a chance to fix it.flowTimeout, so a never-corrected mismatch still terminates. Genuine non-recoverable errors still fail loudly.Test plan
go vet ./cmd/auth-bootstrap/andgo build ./cmd/auth-bootstrap/clean (via the macOS CGO task env)task test:macos— all packages pass except a pre-existingpkg/serverbuild failure ondevelop(undefined: renderProfileinprofile_test.go), unrelated to this change