Skip to content

Conversation

Copy link

Copilot AI commented Dec 23, 2025

Enables users to authenticate with multiple GitHub accounts simultaneously and switch between them. Each account maintains isolated data and cache.

Implementation

Account Management (services/accountService.ts)

  • CRUD operations for accounts stored in localStorage
  • Auto-migration from legacy single-account storage
  • Account structure: { id, token, user, addedAt }

Cache Isolation (services/cacheService.ts)

  • Namespace cache keys by account ID: vibe_github_cache_{accountId}_{key}
  • Enhanced clearCache() with account-specific cleanup modes
  • Prevents cross-account data leakage

Account Switcher UI (components/AccountSwitcher.tsx)

  • Dropdown showing all accounts with avatars
  • Active account indicator, per-account removal
  • Accessible with keyboard navigation and ARIA labels

State Refactoring (App.tsx)

  • Changed from single token/user to accounts/activeAccount
  • Navigation reset on account switch
  • Cleanup on account removal and sign-out

Usage

// Switch accounts
handleSwitchAccount('username');

// Remove account (clears associated cache)
handleRemoveAccount('username');

// Sign out all (clears all accounts and cache)
handleLogout();

Screenshots

Account Switcher
Account Switcher

Shows active account indicator, remove buttons on hover/focus, and add account option.

Migration
Existing users automatically migrated on first load - legacy gh_token/gh_user converted to new account system with cleanup of old storage.

Security

  • Complete data isolation per account
  • Proper token cleanup on removal
  • CodeQL scan: 0 vulnerabilities
Original prompt

This section details on the original issue you should resolve

<issue_title>Add support for multiple accounts</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits December 23, 2025 09:38
Co-authored-by: friuns <7095563+friuns@users.noreply.github.com>
Co-authored-by: friuns <7095563+friuns@users.noreply.github.com>
Co-authored-by: friuns <7095563+friuns@users.noreply.github.com>
Co-authored-by: friuns <7095563+friuns@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for multiple accounts Add multiple account support Dec 23, 2025
Copilot AI requested a review from friuns December 23, 2025 09:52
@github-actions github-actions bot temporarily deployed to commit December 23, 2025 16:22 Inactive
@github-actions
Copy link

🚀 Netlify Deployment

Deploy URL: https://694ac1c491fdb80ca47bc70f--my-test-site3.netlify.app

Branch: copilot/add-support-for-multiple-accounts-again
Commit: 98140d0

@github-actions
Copy link

🚀 Netlify Deployment

Deploy URL: https://694ac1c74d013e0b8a54a742--my-test-site3.netlify.app

Branch: copilot/add-support-for-multiple-accounts-again
Commit: ffe5e9e

@github-actions
Copy link

🚀 Netlify Deployment

Deploy URL: https://694ac1c357fa50367f56abb7--my-test-site3.netlify.app

Branch: copilot/add-support-for-multiple-accounts-again
Commit: fa3ffc7

@github-actions
Copy link

🚀 Netlify Deployment

Deploy URL: https://694ac1c86eaebd0dde46aaf9--my-test-site3.netlify.app

Branch: copilot/add-support-for-multiple-accounts-again
Commit: 2a0d7a8

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for multiple accounts

2 participants