fix(webapp): filter dev environments by userId in OrganizationsPresenter (#3273)

fix: filter dev environments by userId in OrganizationsPresenter
This commit is contained in:
Eric Allam
2026-03-26 07:59:39 +00:00
committed by GitHub
parent 97d2f72063
commit efcafdf388
2 changed files with 11 additions and 1 deletions
@@ -0,0 +1,6 @@
---
area: webapp
type: fix
---
Fix `OrganizationsPresenter.#getEnvironment` matching the wrong development environment on teams with multiple members. All dev environments share the slug `"dev"`, so the previous `find` by slug alone could return another member's environment. Now filters DEVELOPMENT environments by `orgMember.userId` to ensure the logged-in user's dev environment is selected.
@@ -210,7 +210,11 @@ export class OrganizationsPresenter {
})[];
}) {
if (environmentSlug) {
const env = environments.find((e) => e.slug === environmentSlug);
const env = environments.find(
(e) =>
e.slug === environmentSlug &&
(e.type !== "DEVELOPMENT" || e.orgMember?.userId === user.id)
);
if (env) {
return env;
}