Skip to content

Commit e6ec716

Browse files
authored
feat(auth): add Discord as auth provider with guild membership verification (#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
2 parents 232d735 + 08935db commit e6ec716

21 files changed

Lines changed: 1351 additions & 1011 deletions
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TABLE "kilocode_users" ADD COLUMN "discord_server_membership_verified_at" timestamp with time zone;--> statement-breakpoint
2+
ALTER TABLE "user_auth_provider" ADD COLUMN "display_name" text;

0 commit comments

Comments
 (0)