Skip to content

fix: reauth stale GitHub OAuth tokens#10602

Open
s-zaizen wants to merge 3 commits into
warpdotdev:masterfrom
s-zaizen:s-zaizen/gh10053-refresh-github-auth
Open

fix: reauth stale GitHub OAuth tokens#10602
s-zaizen wants to merge 3 commits into
warpdotdev:masterfrom
s-zaizen:s-zaizen/gh10053-refresh-github-auth

Conversation

@s-zaizen
Copy link
Copy Markdown
Contributor

Description

Handles stale or invalid GitHub OAuth tokens when loading GitHub repo info. If userGithubInfo fails in the stale-token path, Warp now routes the user back through GitHub auth by requesting a fresh GitHub integration auth transaction, with a fallback to the generic GitHub connect URL.

Linked Issue

Closes #10053

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes).
スクリーンショット 2026-05-10 22 32 51

Testing

  • cargo fmt

  • cargo test -p warp server::server_api::integrations::tests --lib

  • cargo test -p warp settings_view::update_environment_form::tests::test_render_repos_field_auth_required --lib

  • cargo test -p warp settings_view::update_environment_form::tests::test_render_repos_field_error_state --lib

  • cargo clippy -p warp --lib --tests -- -D warnings

  • I have manually tested my changes locally with ./script/run

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Changelog Entries for Stable

CHANGELOG-BUG-FIX: Fixed GitHub reauthorization when a stored OAuth token is stale or revoked.

@cla-bot cla-bot Bot added the cla-signed label May 10, 2026
@github-actions github-actions Bot added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label May 10, 2026
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 10, 2026

@s-zaizen

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

oz-for-oss[bot]
oz-for-oss Bot previously requested changes May 10, 2026
Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR adds client-side handling to route stale GitHub OAuth token failures through a fresh GitHub auth transaction.

Concerns

  • The new UserFacingError union variant is converted to a generic error after stale-token detection, so auth-related user-facing failures can still bypass the reauth flow.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread app/src/server/server_api/integrations.rs
Treat userGithubInfo failures from stale or invalid GitHub OAuth credentials as an auth-required state, and request a fresh GitHub integration auth transaction before falling back to the generic connect URL.
@s-zaizen s-zaizen force-pushed the s-zaizen/gh10053-refresh-github-auth branch from ee431d3 to a998edb Compare May 10, 2026 13:51
@s-zaizen
Copy link
Copy Markdown
Contributor Author

/oz-review

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 10, 2026

@s-zaizen

I'm re-reviewing this pull request in response to a review request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

oz-for-oss[bot]
oz-for-oss Bot previously requested changes May 10, 2026
Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR routes stale GitHub OAuth-token failures from userGithubInfo into a fresh GitHub authorization flow and updates the environment form to surface auth-required results.

Concerns

  • The refresh heuristic currently treats any missing UserGithubInfo response data as a stale GitHub credential, which can misroute unrelated GraphQL/backend failures into GitHub OAuth instead of showing an error.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread app/src/server/server_api/integrations.rs
@s-zaizen
Copy link
Copy Markdown
Contributor Author

/oz-review

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 11, 2026

@s-zaizen

I'm re-reviewing this pull request in response to a review request.

You can view the conversation on Warp.

I reviewed this pull request and requested human review from: @Legoben.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot dismissed stale reviews from themself May 11, 2026 05:11

Oz no longer requests changes for this pull request after the latest automated review.

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR routes stale or invalid GitHub OAuth-token failures from userGithubInfo into a fresh GitHub auth flow, adds the UserFacingError union handling needed by the client query, and updates the environment-form UI/tests for the auth-required state.

Concerns

  • No blocking correctness or security concerns found.
  • One UI resilience suggestion is inline.

Verdict

Found: 0 critical, 0 important, 1 suggestions

Approve with nits

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread app/src/settings_view/update_environment_form.rs Outdated
@oz-for-oss oz-for-oss Bot requested a review from Legoben May 11, 2026 05:11
Co-authored-by: oz-for-oss[bot] <277970191+oz-for-oss[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed external-contributor Indicates that a PR has been opened by someone outside the Warp team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redirect to GitHub auth flow if token is invalid

1 participant