feat: multi-account GitHub linking — link work/personal accounts & view combined stats (#2498)#2499
Open
IshitaSingh0822 wants to merge 11 commits into
Open
Conversation
…ines, revert lockfile
- Add GET /api/accounts route to list linked accounts - Add POST /api/accounts/link to initiate OAuth flow - Add DELETE /api/accounts/link/:githubLogin to unlink - Add /settings page with linked accounts management UI - Update AccountToggle with avatars and WCAG keyboard accessibility - Add migration for linked_accounts view with RLS policies
GSSoC Label Checklist 🏷️@Umbrella-io — please apply the appropriate labels before merging: Difficulty (pick one):
Quality (optional):
Validation (required to score):
|
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
Implements multi-account GitHub linking so developers can connect separate personal and work GitHub identities to a single DevTrack session, view combined contribution stats, and switch between accounts via the dashboard header switcher.
Closes #2498
Type of Change
What Changed
src/app/api/accounts/route.ts— GET endpoint to list all linked GitHub accountssrc/app/api/accounts/link/route.ts— POST endpoint to initiate GitHub OAuth flow for a second accountsrc/app/api/accounts/[githubLogin]/route.ts— DELETE endpoint to unlink an account by GitHub loginsrc/app/settings/page.tsx— new /settings page with linked accounts management UI (add/remove, avatar display)src/components/AccountToggle.tsx— updated switcher with GitHub avatars, Combined view, and WCAG 2.1 AA keyboard accessibilitysupabase/migrations/20260617000000_add_linked_accounts_view.sql— linked_accounts view + RLS select/delete policiesHow to Test
/settingsand click "Link another GitHub account"/settings— linked account appears with avatar and added date/dashboard— account switcher appears at the bottom of the header/settings— account disappears immediatelyExpected result: accounts link/unlink correctly, switcher updates all dashboard widgets, tokens never appear in plaintext in session or DB
Checklist
console.log, debug code, or commented-out blocksnpm run lintpasses locallynpm run type-check)Accessibility (UI changes only)
Additional Context
Access tokens are stored AES-256-GCM encrypted using the existing
encryptToken/decryptTokenfromsrc/lib/crypto.ts— same pattern as the existinguser_github_accountstable. No breaking changes to existing single-account behaviour; fully additive.