Skip to content

Conversation

@jess-daniel
Copy link
Member

WORK IN PROGRESS

Summary

Implemented multi-account token management with IndexedDB:

  1. Created IndexedDB Storage (src/oauth/indexeddb-storage.ts)

    • Stores tokens grouped by provider and email
    • Methods: saveToken, getToken, getTokensByProvider, listAccounts, deleteToken, deleteTokensByProvider, clearAll
  2. Updated Token Types (src/oauth/types.ts)

    • Added email and accountId to ProviderTokenData
    • Added AccountInfo interface
  3. Created Email Fetcher (src/oauth/email-fetcher.ts)

    • Fetches user email from OAuth providers (GitHub, Gmail, Notion)
    • Called after token exchange
  4. Updated OAuth Manager (src/oauth/manager.ts)

    • Replaced localStorage with IndexedDB (when no callbacks)
    • Fetches email after token exchange
    • Updated methods to support email parameter
    • Added listAccounts() and disconnectAccount() methods
    • Removed skipIndexedDB flag (uses same pattern as before: callbacks if provided, otherwise IndexedDB)
  5. Updated Client API (src/client.ts)

    • Added listAccounts(provider) method
    • Added disconnectAccount(provider, email) method
    • Updated isAuthorized(), getProviderToken(), setProviderToken(), getAuthorizationStatus() to support email parameter
    • Updated disconnectProvider() to disconnect all accounts
  6. Updated Config Types (src/config/types.ts)

    • Updated callback signatures to support email parameter
  7. Updated Server Adapter (src/adapters/base-handler.ts)

    • Updated setProviderToken call to match new signature
  8. Exported Types (src/index.ts)

    • Added AccountInfo to exports

All linter errors are fixed. The implementation follows the same pattern as before: use database callbacks when provided, otherwise use IndexedDB (replacing localStorage).`

@jess-daniel jess-daniel self-assigned this Nov 25, 2025
@jess-daniel jess-daniel added the enhancement New feature or request label Nov 25, 2025
@github-project-automation github-project-automation bot moved this to Backlog in Roadmap Nov 25, 2025
@vercel
Copy link

vercel bot commented Nov 25, 2025

Deployment failed with the following error:

You don't have permission to create a Preview Deployment for this Vercel project: integrate-docs.

View Documentation: https://vercel.com/docs/accounts/team-members-and-roles

@jess-daniel jess-daniel marked this pull request as draft November 25, 2025 21:16
@github-project-automation github-project-automation bot moved this from Backlog to Done in Roadmap Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants