Skip to content

refactor(forges): route device-flow revoke-access hint through the adapter#2884

Closed
afonsojramos wants to merge 1 commit into
mainfrom
refactor-forge-adapter-revoke-access
Closed

refactor(forges): route device-flow revoke-access hint through the adapter#2884
afonsojramos wants to merge 1 commit into
mainfrom
refactor-forge-adapter-revoke-access

Conversation

@afonsojramos
Copy link
Copy Markdown
Member

@afonsojramos afonsojramos commented May 12, 2026

Summary

Follow-up to #2874. The "revoke Gitify's access at GitHub → Developer Settings" hint in LoginWithDeviceFlow synthesized a fake Account ({ hostname: GITHUB_HOSTNAME, method: 'GitHub App' }) and shoved it through openAccountSettings. The label was hardcoded "GitHub" and the URL was reconstructed via account-settings dispatch rather than declared by the adapter directly.

  • Add getDeviceFlowRevokeAccessUrl?(hostname): Link to ForgeAdapter.
  • GitHub adapter returns the developer-settings URL.
  • LoginWithDeviceFlow now uses adapter.displayName for the label and opens the adapter-provided URL. The whole hint hides when the adapter doesn't expose one — defensive against future non-GitHub forges that may register a device-flow route.

Test plan

  • `pnpm exec tsc --noEmit` — clean
  • `pnpm lint` — clean
  • `pnpm exec vitest --run src/renderer/routes/LoginWithDeviceFlow.test.tsx src/renderer/utils/forges/github/adapter.test.ts` — passes

@github-actions github-actions Bot added the refactor Refactoring of existing feature label May 12, 2026
@sonarqubecloud
Copy link
Copy Markdown

@setchy
Copy link
Copy Markdown
Member

setchy commented May 12, 2026

even for GHES users

Device code flow isn't supported by GHES...

@afonsojramos
Copy link
Copy Markdown
Member Author

Ah 🙊

@afonsojramos
Copy link
Copy Markdown
Member Author

Closing and merging with the suggested work in #2887

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Refactoring of existing feature

Development

Successfully merging this pull request may close these issues.

2 participants