Skip to content

fix: working on githb token expiring - #62

Merged
callicles merged 2 commits into
mainfrom
nicolas/work-fix-login-expiring
May 12, 2026
Merged

fix: working on githb token expiring#62
callicles merged 2 commits into
mainfrom
nicolas/work-fix-login-expiring

Conversation

@callicles

@callicles callicles commented May 12, 2026

Copy link
Copy Markdown
Contributor

Note

Medium Risk
Touches GitHub OAuth/session-adjacent flows and adds token refresh/rotation logic plus new user DB columns, which could affect login, authorization checks, and token revocation if misconfigured (e.g., missing GitHub App expiry setting).

Overview
Adds refreshable GitHub App user-token support by storing access+refresh tokens with expiries and a githubTokenKind discriminator in the users table (new migration + schema updates).

OAuth callback now requires GitHub’s expiring user tokens to be enabled, persists the token pair via setUserGithubTokens, and downstream GitHub calls (admin authorization + bypass autocomplete) now obtain tokens through a new getValidUserAccessToken helper that auto-refreshes/rotates tokens with concurrency guards.

Logout now best-effort revokes the user’s GitHub App grant, clears stored token columns, and emits an audit event; Admin/Contributor pages add a re-auth banner when the user is on a legacy/non-refreshable token row. Docs were updated to clarify GitHub App credentials and the required token-expiry setting, and tests were updated/added for token refresh and updated mocks.

Reviewed by Cursor Bugbot for commit be1b9da. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented May 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
v0-cla-bot-application Ready Ready Preview, Comment, Open in v0 May 12, 2026 7:37pm

Request Review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit bdda7dc. Configure here.

Comment thread lib/github/user-token.ts
@callicles
callicles merged commit 0d85062 into main May 12, 2026
13 checks passed
@callicles
callicles deleted the nicolas/work-fix-login-expiring branch May 12, 2026 19:44
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