Skip to content

fix(den): persist active org for legacy proxy requests#1503

Merged
src-opn merged 1 commit intodevfrom
task/persist-active-org-legacy-proxy
Apr 20, 2026
Merged

fix(den): persist active org for legacy proxy requests#1503
src-opn merged 1 commit intodevfrom
task/persist-active-org-legacy-proxy

Conversation

@src-opn
Copy link
Copy Markdown
Collaborator

@src-opn src-opn commented Apr 20, 2026

Summary

  • follow up on fix(den): proxy legacy org-scoped routes #1502 by separating legacy org-path forwarding from API-key scoping when resolving the active organization
  • persist activeOrganizationId back onto the session for legacy /v1/orgs/:orgId/* requests so older clients fully recover after the path migration
  • keep API-key-scoped behavior unchanged while fixing missing-session hydration for proxied user requests

Testing

  • pnpm install
  • pnpm --filter @openwork-ee/utils build && pnpm --filter @openwork-ee/den-db build
  • pnpm --filter @openwork-ee/den-api exec tsc --noEmit
  • bun test ee/apps/den-api/test/org-invitations.test.ts
  • local Den stack live check of GET /api/den/v1/orgs/:orgId/api-keys and GET /api/den/v1/api-keys with the session active_organization_id manually nulled before each request; both returned 200 and rehydrated the session org

Treat legacy '/v1/orgs/:orgId/*' forwarding differently from API-key scoping so proxied requests can still hydrate a missing session active organization. This keeps older clients working across moved endpoints while preserving API-key behavior.
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openwork-app Ready Ready Preview, Comment Apr 20, 2026 7:16pm
openwork-den Ready Ready Preview, Comment Apr 20, 2026 7:16pm
openwork-den-worker-proxy Ready Ready Preview, Comment Apr 20, 2026 7:16pm
openwork-landing Ready Ready Preview, Comment, Open in v0 Apr 20, 2026 7:16pm
openwork-share Ready Ready Preview, Comment Apr 20, 2026 7:16pm

@github-actions
Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

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.

1 participant