Merged
Conversation
Someday we may support dark mode, but *all* the colors must be properly handled. Having only *some* switch for dark mode made the system unusable at night. Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
On the "new project" page, when a GitHub user's OAuth token expires, repo_data now clears the stale token and returns nil (distinct from [] for no repos), so the view shows a "Reconnect to GitHub" button instead of an empty dropdown. After reconnecting, OAuth redirects back to the new project page. Also adds a safe ?clear_token=1 param for debugging and three integration tests covering the reconnect flow. This doesn't fully handle the "GitHub OAuth token expires" situation, but it handles the more obvious case, and early enough that it won't surprise users. I asked Claude Code "When do these GitHub OAuth tokens expire? Can we anticipate this?" and it gave me the following answer. It may be wrong; I didn't revoke my token, yet it stopped working after a period of time without me revoking it. Still, it's a claim, and this information might help identify a better answer later: > This app uses a GitHub OAuth App (not a GitHub App). Here's the key > distinction: > GitHub OAuth App tokens don't expire on their own. They are long-lived and > persist until one of these events: > - The user revokes the app's access in GitHub Settings > Applications > - An organization admin revokes access for their org > - The OAuth App owner revokes the token programmatically > - GitHub detects a leaked token and revokes it > - The user changes their password (revokes all OAuth tokens) > So the "stale token" scenario is relatively rare — it's not a time-based > expiration but an explicit revocation event. The most common real-world cause > is probably users revoking app access in their GitHub settings and then > returning to the badge site, or password changes. > Can we anticipate it? Not really, because there's no expiration timestamp to > check. The only way to know is to try to use the token and get a 401, which is > exactly what our reconnect flow now handles. > One thing worth noting: GitHub also offers GitHub Apps (as opposed to OAuth > Apps), which do have expiring user tokens (8 hours) with refresh tokens. If > the app were ever migrated to that model, we'd want proactive refresh logic. > But with the current OAuth App setup, the reactive approach (detect 401, show > reconnect) is the right one. Co-Authored-by: David A. Wheeler <dwheeler@dwheeler.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: David A. Wheeler <dwheeler@dwheeler.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.
No description provided.