refactor(login): organize login routes and components by forge#3030
Merged
Conversation
|
setchy
approved these changes
Jul 10, 2026
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.



Summary
The PAT login route comingled GitHub and Gitea logic through
isGiteaconditionals. Now that forge adapters exist, this organizes the login components and routes the same way: forge-specific knowledge lives in forge-specific modules, and shared code stays free of forge branching.components/login/LoginWithPersonalAccessTokenForm, which owns form state, validation, and submission. Forge-specific copy is supplied via props, and the GitHub-only recommended-scopes hint renders through achildrenslot, so the shared form contains zero forge conditionals.utils/forges/<forge>/:routes/github/LoginWithPersonalAccessTokenandroutes/gitea/LoginWithPersonalAccessTokensupply their own copy to the shared form.routes/github/LoginWithDeviceFlowandroutes/github/LoginWithOAuthAppmove underroutes/github/since GitHub is the only forge with those capability bundles; they no longer read the forge from router state./login/github/device-flow,/login/github/personal-access-token,/login/github/oauth-app,/login/gitea/personal-access-token.LoginMethodDescriptorgains a requiredauthMethodand drops the routerstatefield (LoginRouteStateis deleted). With routes being forge-specific, no forge needs to travel through navigation state anymore; re-auth still passes theaccount.Accountsis now fully adapter-driven: the "Add new account" menu renders fromlistAdapters()×loginMethods(existing testids preserved), and re-authentication resolves its destination via the account's adapter descriptor instead of a hardcodedswitch. An unmatched auth method now logs an error instead of silently doing nothing.Adding a new forge (e.g. Bitbucket) no longer touches any shared login component: register the adapter, add its route components, and the login screen, add-account menu, and re-auth flow pick it up.
User-visible changes
Login with <forge> (<method>), so the GitHub PAT and OAuth App entries read "Login with GitHub (Personal Access Token)" and "Login with GitHub (OAuth App)". Reproducing the old inconsistent labels would have required reintroducing a forge conditional.Testing
forge: 'gitea').Closes #2866