Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR updates the OSS web, API, and SDK auth flows to support port-aware (namespaced) cookies for local multi-environment setups, reducing session/cookie collisions when running multiple instances on the same host.
Changes:
- Add helpers to derive a local cookie name suffix and apply it to region selection, PostHog persistence, and SuperTokens cookie handling in the OSS frontend.
- Add server-side SuperTokens cookie name overrides (API) and update auth/analytics services to read the access token from port-suffixed cookies.
- Update the Python SDK middleware and Playwright teardown to look up the correct access-token cookie name in local environments.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| web/tests/playwright/global-teardown.ts | Extract access token from state.json using a port-aware cookie name heuristic. |
| web/oss/src/lib/helpers/region.ts | Namespace the region preference cookie key using a local port suffix. |
| web/oss/src/lib/helpers/cookies.ts | Introduce a helper for deriving a local cookie port suffix. |
| web/oss/src/lib/helpers/auth/supertokensCookieHandler.ts | Add a SuperTokens cookie handler wrapper to rewrite cookie names for local namespacing. |
| web/oss/src/lib/helpers/analytics/AgPosthogProvider.tsx | Allow injecting PostHog config and namespace persistence in local dev. |
| web/oss/src/config/frontendConfig.ts | Wire the local SuperTokens cookie handler into the frontend config. |
| sdk/agenta/sdk/middlewares/routing/auth.py | Use a port-aware sAccessToken_<port> cookie name for localhost/IP hosts. |
| api/test-auth.http | Document port-suffixed cookie behavior in local multi-env setups. |
| api/oss/src/services/auth_service.py | Read access token from cookies via the new SuperTokens cookie-name helper. |
| api/oss/src/services/analytics_service.py | Detect session auth via the new cookie-name helper. |
| api/oss/src/core/auth/supertokens/cookie_names.py | Add API-side logic to compute/override SuperTokens cookie names (port suffixing) and helpers to read cookies. |
| api/oss/src/core/auth/supertokens/config.py | Apply SuperTokens cookie-name overrides during SuperTokens initialization. |
| api/ee/tests/manual/auth/QUICK-START.md | Document port-suffixed cookie names for local usage. |
| api/ee/tests/manual/auth/04-policy-enforcement.http | Document port-suffixed cookie names for local usage. |
| api/ee/tests/manual/auth/03-identity-tracking.http | Document port-suffixed cookie names for local usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.