Skip to content

Add GitHub authentication support to extension#182

Draft
Copilot wants to merge 6 commits intomainfrom
copilot/enable-auth-github-login
Draft

Add GitHub authentication support to extension#182
Copilot wants to merge 6 commits intomainfrom
copilot/enable-auth-github-login

Conversation

Copy link
Contributor

Copilot AI commented Feb 7, 2026

Adds GitHub authentication using VS Code's native authentication provider to enable future GitHub API-dependent features (repository tracking, team collaboration, analytics).

Implementation

  • Authentication flow: Uses vscode.authentication.getSession('github', ['read:user']) with minimal read-only scope
  • Session management: Automatic restoration on startup with createIfNone: false to avoid re-prompting; clears state on expiration
  • State persistence: Stores auth status and username in context.globalState for cross-session availability

Commands

// New commands in package.json
copilot-token-tracker.authenticateGitHub
copilot-token-tracker.signOutGitHub

UI

  • New "GitHub Auth" tab in Diagnostics panel showing authentication status
  • Authenticate/sign out buttons with webview message passing back to extension
  • Real-time status updates after auth actions

Key Methods

private async restoreGitHubSession(): Promise<void>
  // Called in constructor - silently restores session if previously authenticated
  
public async authenticateWithGitHub(): Promise<void>
  // Prompts for auth, stores session and state
  
public async signOutFromGitHub(): Promise<void>
  // Clears in-memory session and persisted state

Session reconciliation handles cases where in-memory session is undefined but persisted state shows authenticated (e.g., after session expiration).

Original prompt

Enable auth in the exension to login with the configured github account in vs code. this will unlock different features in the future.


✨ 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 5 commits February 7, 2026 20:18
Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
Copilot AI changed the title [WIP] Add authentication for GitHub login in extension Add GitHub authentication support to extension Feb 7, 2026
Copilot AI requested a review from rajbos February 7, 2026 20:26
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.

2 participants

Comments