Merged
Conversation
f9f4f75 to
7052b5f
Compare
7052b5f to
1a7459e
Compare
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
Fixes CLI GitHub OAuth login polling for Codebuff and Freebuff when deterministic hardware fingerprints are reused across login attempts.
Root Cause
The newer stable CLI fingerprint means repeated login attempts can share the same
fingerprint_id, while each generated login URL has a fresh auth hash becauseexpiresAtchanges. The old polling flow effectively treated fingerprint state as the login-attempt binding, which could leave stale hashes or return the wrong active session on shared devices or concurrent login attempts.Changes
session.cli_auth_hashso each CLI session is bound to the specific login auth hash that created it.(fingerprint_id, cli_auth_hash)for non-null auth hashes, making each CLI auth code single-use across accounts.fingerprint_id,cli_auth_hash,type = 'cli', and active expiry.fingerprint.sig_hashduring CLI login; fingerprint now identifies the device, whilesession.cli_auth_hashidentifies the login attempt.auth_codewhen Codebuff/onboardredirects an unauthenticated browser session back to/login.expiresAtvalidation for status polling and numeric onboard expiry checks.Validation
bun run typecheckinpackages/internalbun run typecheckinwebbun run typecheckinfreebuff/webbun test web/src/app/api/auth/cli/status/__tests__/status.test.ts web/src/app/onboard/__tests__/helpers.test.tsgit diff --check