Skip to content

Small fixes#2699

Merged
david-a-wheeler merged 2 commits intomainfrom
small_fixes
Feb 13, 2026
Merged

Small fixes#2699
david-a-wheeler merged 2 commits intomainfrom
small_fixes

Conversation

@david-a-wheeler
Copy link
Collaborator

No description provided.

david-a-wheeler and others added 2 commits February 12, 2026 21:19
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>
@david-a-wheeler david-a-wheeler merged commit 904bceb into main Feb 13, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant