feat: auto-link GitHub profile from OAuth#1356
Open
evanjacobson wants to merge 18 commits intomainfrom
Open
Conversation
When a user links GitHub via OAuth, their profile card now shows the GitHub profile URL derived from the OAuth display_name, overriding any manually set github_url. The edit modal replaces the GitHub text input with a link to /connected-accounts when GitHub is OAuth-linked.
When GitHub is linked via OAuth, the edit modal now fully excludes the GitHub field from state, validation, and mutation — preventing stale manual values from interfering. Also validates GitHub login format and improves comment accuracy on display_name assignments.
Replace inline auth provider query in profile page with a dedicated getOAuthDisplayNames function that returns a Map<AuthProviderId, string> for O(1) lookup. Query filters for non-null display_name in SQL.
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (6 files)
Reviewed by gpt-5.4-20260305 · 1,489,288 tokens |
6 tasks
evanjacobson
added a commit
that referenced
this pull request
Mar 23, 2026
…cation (#1354) ## Summary - Add Discord as an OAuth auth provider on the user profile page, using a separate Discord OAuth app (distinct from the existing bot) - Add Discord guild membership verification — checks if the user is a member of the Kilo Discord server via the bot API - Auto-verify guild membership when a user first links their Discord account; re-verify button available for non-members - New DB migration adds `discord_server_member` and `discord_server_member_at` columns to `kilocode_users` ## Verification - [x] `pnpm typecheck` — passes - [x] `pnpm test` — passes - [x] Link Discord account on profile page - [x] Guild membership auto-verifies after linking - [x] Re-verify button works for non-members - [x] Soft delete nullifies new Discord columns ## Visual Changes New "Discord Server Membership" card on the user profile page showing: - Prompt to link Discord if not connected - Green checkmark with verification date if user is a Kilo Discord member - "Not a member" status with invite link and re-verify button otherwise ## Loom (Kilo Team only) https://www.loom.com/share/3512eb86ef38454d86c95fa7cbfc51f1 ## Other PRs for this feature #1356 ## Reviewer Notes - Discord OAuth app env vars (`DISCORD_OAUTH_CLIENT_ID`, `DISCORD_OAUTH_CLIENT_SECRET`) are separate from the existing bot token (`DISCORD_OAUTH_BOT_TOKEN`) — the bot token is used server-side for guild membership checks - `discord_provider_account_id` was intentionally excluded from the `getDiscordGuildStatus` response to minimize API surface - Guild check errors are caught and sanitized to avoid leaking internal details (rate limits, missing env vars) to the client
Base automatically changed from
feature/user-profile-connect-social-accounts
to
main
March 23, 2026 18:55
…ofile-autoconnect-github
…ofile-autoconnect-github
…Kilo-Org/cloud into feature/user-profile-autoconnect-github
6 tasks
evanjacobson
added a commit
that referenced
this pull request
Mar 24, 2026
## Summary #1354 with db migrations not breaking. - there is zero diff between the other files and the previous PR - Add Discord as an OAuth auth provider on the user profile page, using a separate Discord OAuth app (distinct from the existing bot) - Add Discord guild membership verification — checks if the user is a member of the Kilo Discord server via the bot API - Auto-verify guild membership when a user first links their Discord account; re-verify button available for non-members - New DB migration adds `discord_server_member` and `discord_server_member_at` columns to `kilocode_users` ## Verification - [x] `pnpm typecheck` — passes - [x] `pnpm test` — passes - [x] Link Discord account on profile page - [x] Guild membership auto-verifies after linking - [x] Re-verify button works for non-members - [x] Soft delete nullifies new Discord columns ## Visual Changes New "Discord Server Membership" card on the user profile page showing: - Prompt to link Discord if not connected - Green checkmark with verification date if user is a Kilo Discord member - "Not a member" status with invite link and re-verify button otherwise ## Loom (Kilo Team only) https://www.loom.com/share/3512eb86ef38454d86c95fa7cbfc51f1 ## Other PRs for this feature #1356 ## Reviewer Notes - Discord OAuth app env vars (`DISCORD_OAUTH_CLIENT_ID`, `DISCORD_OAUTH_CLIENT_SECRET`) are separate from the existing bot token (`DISCORD_OAUTH_BOT_TOKEN`) — the bot token is used server-side for guild membership checks - `discord_provider_account_id` was intentionally excluded from the `getDiscordGuildStatus` response to minimize API surface - Guild check errors are caught and sanitized to avoid leaking internal details (rate limits, missing env vars) to the client
14 tasks
4 tasks
evanjacobson
commented
Mar 24, 2026
Contributor
Author
There was a problem hiding this comment.
trpc changes from #1451 did not get regenerated
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
https://github.com/<username>derived from the OAuthdisplay_name, overriding any manually setgithub_url/connected-accountswhen GitHub is OAuth-linked, fully excluding the field from state, validation, and mutationgithub_urlis preserved in the DB and resurfaces if the user unlinks GitHubBlocked by
display_namecolumn touser_auth_provider(required migration)UI
Test plan
https://github.com/<login>/connected-accountsgithub_urlresurfaces in both card and edit modal