Skip to content

feat: Scope oauth tokens by org, replace flat project list with org-keyed map#1210

Draft
charlesvien wants to merge 2 commits intomainfrom
03-11-scope_first_party_oauth_tokens_by_organization_instead_of_team
Draft

feat: Scope oauth tokens by org, replace flat project list with org-keyed map#1210
charlesvien wants to merge 2 commits intomainfrom
03-11-scope_first_party_oauth_tokens_by_organization_instead_of_team

Conversation

@charlesvien
Copy link
Member

@charlesvien charlesvien commented Mar 12, 2026

Issue: #1101
PostHog/posthog PR: PostHog/posthog#50725

  1. Replace flat availableProjectIds/availableOrgIds arrays with org-keyed orgProjectsMap in auth store
  2. Add listOrgProjects API method and buildOrgProjectsMap helper to fetch projects per organization
  3. Remove scoped_teams from OAuth token response schema and stored tokens
  4. Simplify useProjects hook to derive project list from org map instead of fetching user data
  5. Move currentUser query out of useProjects into ProjectSwitcher where it's actually used
  6. Update mobile auth store to drop scoped_teams dependency

@charlesvien charlesvien changed the title Scope oauth tokens by org, replace flat project list with org-keyed map feat: Scope oauth tokens by org, replace flat project list with org-keyed map Mar 12, 2026
@charlesvien charlesvien force-pushed the 03-11-scope_first_party_oauth_tokens_by_organization_instead_of_team branch from 0047124 to b2dcc63 Compare March 12, 2026 03:01
@charlesvien charlesvien force-pushed the 03-11-optimistically_render_conversation_items_before_subscription_confirms branch from 400d3be to 96726e1 Compare March 12, 2026 03:01
@charlesvien charlesvien marked this pull request as ready for review March 12, 2026 05:08
@charlesvien charlesvien force-pushed the 03-11-optimistically_render_conversation_items_before_subscription_confirms branch from 96726e1 to 7da2a2f Compare March 12, 2026 05:20
@charlesvien charlesvien force-pushed the 03-11-scope_first_party_oauth_tokens_by_organization_instead_of_team branch from b2dcc63 to 17f5764 Compare March 12, 2026 05:20
@charlesvien charlesvien changed the base branch from 03-11-optimistically_render_conversation_items_before_subscription_confirms to graphite-base/1210 March 12, 2026 06:10
@charlesvien charlesvien force-pushed the 03-11-scope_first_party_oauth_tokens_by_organization_instead_of_team branch from 17f5764 to c908bed Compare March 12, 2026 06:10
@charlesvien charlesvien force-pushed the 03-11-scope_first_party_oauth_tokens_by_organization_instead_of_team branch from c908bed to 3466079 Compare March 12, 2026 13:49
@graphite-app graphite-app bot changed the base branch from graphite-base/1210 to 03-11-add_multi-agent_command_center_grid_view March 12, 2026 13:49
@charlesvien charlesvien force-pushed the 03-11-scope_first_party_oauth_tokens_by_organization_instead_of_team branch from 3466079 to 7345188 Compare March 12, 2026 13:49
@charlesvien charlesvien force-pushed the 03-11-add_multi-agent_command_center_grid_view branch from eda657f to 3349d43 Compare March 12, 2026 16:27
@charlesvien charlesvien force-pushed the 03-11-scope_first_party_oauth_tokens_by_organization_instead_of_team branch from 7345188 to 1a9cd2e Compare March 12, 2026 16:27
@charlesvien charlesvien force-pushed the 03-11-add_multi-agent_command_center_grid_view branch from 3349d43 to 8841195 Compare March 12, 2026 16:56
@charlesvien charlesvien force-pushed the 03-11-scope_first_party_oauth_tokens_by_organization_instead_of_team branch from 1a9cd2e to 0c6b1a9 Compare March 12, 2026 16:56
@charlesvien charlesvien force-pushed the 03-11-add_multi-agent_command_center_grid_view branch from 8841195 to b6097b6 Compare March 12, 2026 17:05
@charlesvien charlesvien force-pushed the 03-11-scope_first_party_oauth_tokens_by_organization_instead_of_team branch from 0c6b1a9 to 2f2a146 Compare March 12, 2026 17:05
@charlesvien charlesvien force-pushed the 03-11-add_multi-agent_command_center_grid_view branch from b6097b6 to eabb80c Compare March 12, 2026 17:12
@charlesvien charlesvien force-pushed the 03-11-scope_first_party_oauth_tokens_by_organization_instead_of_team branch 2 times, most recently from 47a8225 to a88c4e3 Compare March 12, 2026 17:27
@charlesvien charlesvien force-pushed the 03-11-add_multi-agent_command_center_grid_view branch from eabb80c to c25c6be Compare March 12, 2026 17:27
@charlesvien charlesvien force-pushed the 03-11-scope_first_party_oauth_tokens_by_organization_instead_of_team branch from a88c4e3 to 905e267 Compare March 12, 2026 17:38
@charlesvien charlesvien force-pushed the 03-11-add_multi-agent_command_center_grid_view branch from c25c6be to 312eb6d Compare March 12, 2026 17:38
@charlesvien charlesvien force-pushed the 03-11-scope_first_party_oauth_tokens_by_organization_instead_of_team branch from 905e267 to 850b05b Compare March 12, 2026 17:51
@charlesvien charlesvien force-pushed the 03-11-add_multi-agent_command_center_grid_view branch 2 times, most recently from 18943f2 to 7b81176 Compare March 12, 2026 17:58
@charlesvien charlesvien force-pushed the 03-11-scope_first_party_oauth_tokens_by_organization_instead_of_team branch from 850b05b to 326af64 Compare March 12, 2026 17:58
@charlesvien charlesvien force-pushed the 03-11-add_multi-agent_command_center_grid_view branch from 7b81176 to b24f3df Compare March 12, 2026 18:51
@charlesvien charlesvien force-pushed the 03-11-scope_first_party_oauth_tokens_by_organization_instead_of_team branch from 326af64 to 2587d4b Compare March 12, 2026 18:51
@charlesvien charlesvien force-pushed the 03-11-add_multi-agent_command_center_grid_view branch from b24f3df to 0477b11 Compare March 12, 2026 21:40
@charlesvien charlesvien force-pushed the 03-11-scope_first_party_oauth_tokens_by_organization_instead_of_team branch 2 times, most recently from df3e408 to e3aa0a0 Compare March 12, 2026 22:20
@charlesvien charlesvien force-pushed the 03-11-add_multi-agent_command_center_grid_view branch from 0477b11 to 0c73e6a Compare March 12, 2026 22:20
@charlesvien charlesvien changed the base branch from 03-11-add_multi-agent_command_center_grid_view to graphite-base/1210 March 12, 2026 23:05
@charlesvien charlesvien force-pushed the 03-11-scope_first_party_oauth_tokens_by_organization_instead_of_team branch from e3aa0a0 to f8ec45c Compare March 12, 2026 23:11
@graphite-app graphite-app bot changed the base branch from graphite-base/1210 to main March 12, 2026 23:12
@charlesvien charlesvien force-pushed the 03-11-scope_first_party_oauth_tokens_by_organization_instead_of_team branch from f8ec45c to 72e5125 Compare March 12, 2026 23:12
@charlesvien charlesvien force-pushed the 03-11-scope_first_party_oauth_tokens_by_organization_instead_of_team branch from 72e5125 to 20a5789 Compare March 12, 2026 23:21
@charlesvien charlesvien marked this pull request as draft March 13, 2026 01:19
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