Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

PKI application members have to be product users to be added to an app

Carlos Monastyrskifee03966a770
diff --git a/backend/src/server/routes/v1/pki-application-membership-routers/users-router.ts b/backend/src/server/routes/v1/pki-application-membership-routers/users-router.ts
index 48e96755a4..4c2abd4ebc 100644
--- a/backend/src/server/routes/v1/pki-application-membership-routers/users-router.ts
+++ b/backend/src/server/routes/v1/pki-application-membership-routers/users-router.ts
@@ -1,6 +1,5 @@
import { z } from "zod";
-import { AccessScope, OrgMembershipRole, ProjectMembershipRole } from "@app/db/schemas";
import { EventType } from "@app/ee/services/audit-log/audit-log-types";
import { ApiDocsTags } from "@app/lib/api-docs";
import { readLimit, writeLimit } from "@app/server/config/rateLimiter";
@@ -85,7 +84,7 @@ export const registerPkiApplicationUserMembershipRouter = async (server: Fastify
hide: false,
operationId: "addPkiApplicationUserMembers",
description:
- "Add user members to an application by userId, email, or username. Bootstraps org and project membership for users not already present, then attaches them to the application.",
+ "Add user members to an application by userId, email, or username. Only users who are already members of the project can be added.",
tags: [ApiDocsTags.PkiApplications],
params: ApplicationIdParamsSchema,
body: AddUsersBodySchema,
@@ -96,33 +95,6 @@ export const registerPkiApplicationUserMembershipRouter = async (server: Fastify
const projectId = req.internalCertManagerProjectId;
const { emails } = req.body;
- if (emails.length > 0) {
- const bootstrapForApplication = {
- applicationId: req.params.applicationId,
- projectId
- };
-
- await server.services.membershipUser.createMembership({
- permission: req.permission,
- scopeData: { scope: AccessScope.Organization, orgId: req.permission.orgId },
- data: {
- roles: [{ isTemporary: false, role: OrgMembershipRole.NoAccess }],
- usernames: emails
- },
- bootstrapForApplication
- });
-
- await server.services.membershipUser.createMembership({
- permission: req.permission,
- scopeData: { scope: AccessScope.Project, orgId: req.permission.orgId, projectId },
- data: {
- roles: [{ isTemporary: false, role: ProjectMembershipRole.Member }],
- usernames: emails
- },
- bootstrapForApplication
- });
- }
-
const result = await server.services.pkiApplicationMembership.addUserMembers({
actor: req.permission.type,
actorId: req.permission.id,
diff --git a/backend/src/services/membership-user/membership-user-types.ts b/backend/src/services/membership-user/membership-user-types.ts
index 782399972f..396a30647e 100644
--- a/backend/src/services/membership-user/membership-user-types.ts
+++ b/backend/src/services/membership-user/membership-user-types.ts
@@ -37,7 +37,6 @@ export type TCreateMembershipUserDTO = {
temporaryAccessStartTime?: string;
}[];
};
- bootstrapForApplication?: { applicationId: string; projectId: string };
};
export type TUpdateMembershipUserDTO = {
diff --git a/backend/src/services/membership-user/org/org-membership-user-factory.ts b/backend/src/services/membership-user/org/org-membership-user-factory.ts
index c4c8a75704..01d76040ef 100644
--- a/backend/src/services/membership-user/org/org-membership-user-factory.ts
+++ b/backend/src/services/membership-user/org/org-membership-user-factory.ts
@@ -1,13 +1,11 @@
import { ForbiddenError } from "@casl/ability";
-import { AccessScope, OrganizationActionScope, OrgMembershipStatus, ResourceType } from "@app/db/schemas";
+import { AccessScope, OrganizationActionScope, OrgMembershipStatus } from "@app/db/schemas";
import { TUserGroupMembershipDALFactory } from "@app/ee/services/group/user-group-membership-dal";
import { TLicenseServiceFactory } from "@app/ee/services/license/license-service";
import { OrgPermissionActions, OrgPermissionSubjects } from "@app/ee/services/permission/org-permission";
import { assertPermissionBoundary } from "@app/ee/services/permission/permission-fns";
import { TPermissionServiceFactory } from "@app/ee/services/permission/permission-service-types";
-import { ProjectPermissionMemberActions } from "@app/ee/services/permission/project-permission";
-import { ResourcePermissionSub } from "@app/ee/services/permission/resource-permission";
import { getConfig } from "@app/lib/config/env";
import { BadRequestError, ForbiddenRequestError, InternalServerError } from "@app/lib/errors";
import { requestMemoKeys } from "@app/lib/request-context/memo-keys";
@@ -26,10 +24,7 @@ import { TMembershipUserDALFactory } from "../membership-user-dal";
import { TMembershipUserScopeFactory } from "../membership-user-types";
type TOrgMembershipUserScopeFactoryDep = {
- permissionService: Pick<
- TPermissionServiceFactory,
- "getOrgPermission" | "getOrgPermissionByRoles" | "getResourcePermission"
- >;
+ permissionService: Pick<TPermissionServiceFactory, "getOrgPermission" | "getOrgPermissionByRoles">;
tokenService: Pick<TAuthTokenServiceFactory, "createTokenForUser">;
userDAL: Pick<TUserDALFactory, "findById">;
smtpService: Pick<TSmtpService, "sendMail">;
@@ -68,43 +63,27 @@ export const newOrgMembershipUserFactory = ({
dto,
newMembers
) => {
- if (dto.bootstrapForApplication) {
- const { permission: resourcePermission } = await permissionService.getResourcePermission({
- actor: dto.permission.type,
- actorId: dto.permission.id,
- projectId: dto.bootstrapForApplication.projectId,
- resourceType: ResourceType.CertificateApplication,
- resourceId: dto.bootstrapForApplication.applicationId,
- actorAuthMethod: dto.permission.authMethod,
- actorOrgId: dto.permission.orgId
- });
- ForbiddenError.from(resourcePermission).throwUnlessCan(
- ProjectPermissionMemberActions.Create,
- ResourcePermissionSub.Member
- );
- } else {
- const { permission } = await permissionService.getOrgPermission({
- actor: dto.permission.type,
- actorId: dto.permission.id,
- orgId: dto.permission.orgId,
- actorAuthMethod: dto.permission.authMethod,
- actorOrgId: dto.permission.orgId,
- scope: OrganizationActionScope.Any
- });
- ForbiddenError.from(permission).throwUnlessCan(OrgPermissionActions.Create, OrgPermissionSubjects.Member);
+ const { permission } = await permissionService.getOrgPermission({
+ actor: dto.permission.type,
+ actorId: dto.permission.id,
+ orgId: dto.permission.orgId,
+ actorAuthMethod: dto.permission.authMethod,
+ actorOrgId: dto.permission.orgId,
+ scope: OrganizationActionScope.Any
+ });
+ ForbiddenError.from(permission).throwUnlessCan(OrgPermissionActions.Create, OrgPermissionSubjects.Member);
- if (dto.data.roles.length) {
- const permissionRoles = await permissionService.getOrgPermissionByRoles(
- dto.data.roles.map((el) => el.role),
- dto.permission.orgId
+ if (dto.data.roles.length) {
+ const permissionRoles = await permissionService.getOrgPermissionByRoles(
+ dto.data.roles.map((el) => el.role),
+ dto.permission.orgId
+ );
+ for (const permissionRole of permissionRoles) {
+ assertPermissionBoundary(
+ permission,
+ permissionRole.permission,
+ "Cannot grant a role exceeding your own privileges to a new org member"
);
- for (const permissionRole of permissionRoles) {
- assertPermissionBoundary(
- permission,
- permissionRole.permission,
- "Cannot grant a role exceeding your own privileges to a new org member"
- );
- }
}
}
diff --git a/backend/src/services/membership-user/project/project-membership-user-factory.ts b/backend/src/services/membership-user/project/project-membership-user-factory.ts
index 80c0aa8699..c1b0672ce9 100644
--- a/backend/src/services/membership-user/project/project-membership-user-factory.ts
+++ b/backend/src/services/membership-user/project/project-membership-user-factory.ts
@@ -64,22 +64,15 @@ export const newProjectMembershipUserFactory = ({
newUsers
) => {
const scope = getScopeField(dto.scopeData);
- let permission: Awaited<ReturnType<typeof permissionService.getProjectPermission>>["permission"] | null = null;
- if (!dto.bootstrapForApplication) {
- const { permission: projectPermission } = await permissionService.getProjectPermission({
- actor: dto.permission.type,
- actorId: dto.permission.id,
- actionProjectType: ActionProjectType.Any,
- actorAuthMethod: dto.permission.authMethod,
- projectId: scope.value,
- actorOrgId: dto.permission.orgId
- });
- ForbiddenError.from(projectPermission).throwUnlessCan(
- ProjectPermissionMemberActions.Create,
- ProjectPermissionSub.Member
- );
- permission = projectPermission;
- }
+ const { permission } = await permissionService.getProjectPermission({
+ actor: dto.permission.type,
+ actorId: dto.permission.id,
+ actionProjectType: ActionProjectType.Any,
+ actorAuthMethod: dto.permission.authMethod,
+ projectId: scope.value,
+ actorOrgId: dto.permission.orgId
+ });
+ ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionMemberActions.Create, ProjectPermissionSub.Member);
// TODO(namespace): this becomes tricky in namespace due to group flow
const orgMemberships = await membershipUserDAL.find({
@@ -96,10 +89,6 @@ export const newProjectMembershipUserFactory = ({
throw new BadRequestError({ message: `Users ${missingUsers.join(",")} not part of organization` });
}
- if (dto.bootstrapForApplication) {
- return;
- }
-
const { shouldUseNewPrivilegeSystem } = await requestMemoize(
requestMemoKeys.orgFindById(dto.permission.orgId),
() => orgDAL.findById(dto.permission.orgId)
@@ -116,7 +105,7 @@ export const newProjectMembershipUserFactory = ({
shouldUseNewPrivilegeSystem,
[ProjectPermissionMemberActions.AssignRole, ProjectPermissionMemberActions.GrantPrivileges],
ProjectPermissionSub.Member,
- permission as NonNullable<typeof permission>,
+ permission,
permissionRole.permission,
{
userEmail: newUser.email ?? undefined,
diff --git a/backend/src/services/pki-application/pki-application-membership-service.ts b/backend/src/services/pki-application/pki-application-membership-service.ts
index 456ce29c80..72d37c9430 100644
--- a/backend/src/services/pki-application/pki-application-membership-service.ts
+++ b/backend/src/services/pki-application/pki-application-membership-service.ts
@@ -1,22 +1,15 @@
import { ForbiddenError } from "@casl/ability";
import { Knex } from "knex";
-import {
- AccessScope,
- ActionProjectType,
- ProjectMembershipRole,
- RESOURCE_SCOPE,
- ResourceMembershipRole,
- ResourceType
-} from "@app/db/schemas";
+import { AccessScope, RESOURCE_SCOPE, ResourceMembershipRole, ResourceType } from "@app/db/schemas";
import { TGroupDALFactory } from "@app/ee/services/group/group-dal";
import { TPermissionServiceFactory } from "@app/ee/services/permission/permission-service-types";
-import { ProjectPermissionMemberActions, ProjectPermissionSub } from "@app/ee/services/permission/project-permission";
+import { ProjectPermissionMemberActions } from "@app/ee/services/permission/project-permission";
import {
ResourcePermissionApplicationActions,
ResourcePermissionSub
} from "@app/ee/services/permission/resource-permission";
-import { BadRequestError, ForbiddenRequestError, NotFoundError } from "@app/lib/errors";
+import { BadRequestError, NotFoundError } from "@app/lib/errors";
import { ActorType } from "@app/services/auth/auth-type";
import { TApprovalPolicyDALFactory } from "../approval-policy/approval-policy-dal";
@@ -51,7 +44,7 @@ type TPkiApplicationMembershipServiceFactoryDep = {
| "findResourceMembershipsForGroup"
>;
membershipRoleDAL: Pick<TMembershipRoleDALFactory, "create" | "find" | "delete" | "update">;
- permissionService: Pick<TPermissionServiceFactory, "getResourcePermission" | "getProjectPermission">;
+ permissionService: Pick<TPermissionServiceFactory, "getResourcePermission">;
userDAL: Pick<TUserDALFactory, "find" | "findByEmailsOrUsernames">;
identityDAL: Pick<TIdentityDALFactory, "find">;
groupDAL: Pick<TGroupDALFactory, "find">;
@@ -194,24 +187,6 @@ export const pkiApplicationMembershipServiceFactory = ({
const orgMembership = await $assertActorPresentInOrg(actorOrgId, { userId, identityId, groupId });
- let canCreateProjectMember = false;
- try {
- const { permission: projectPermission } = await permissionService.getProjectPermission({
- actor,
- actorId,
- projectId,
- actorAuthMethod,
- actorOrgId,
- actionProjectType: ActionProjectType.CertificateManager
- });
- canCreateProjectMember = projectPermission.can(
- ProjectPermissionMemberActions.Create,
- ProjectPermissionSub.Member
- );
- } catch {
- canCreateProjectMember = false;
- }
-
const membership = await membershipDAL.transaction(async (tx) => {
const existingAppMembershipFilter: Record<string, unknown> = {
scope: RESOURCE_SCOPE,
@@ -241,22 +216,11 @@ export const pkiApplicationMembershipServiceFactory = ({
const existingProjectMembership = await membershipDAL.find(projectMembershipFilter, { tx });
if (existingProjectMembership.length === 0) {
- if (!canCreateProjectMember) {
- throw new ForbiddenRequestError({ message: "You don't have access to perform this action." });
- }
- const projectMembership = await membershipDAL.create(
- {
- scope: AccessScope.Project,
- scopeOrgId: orgMembership.scopeOrgId,
- scopeProjectId: projectId,
- actorUserId: userId ?? null,
- actorIdentityId: identityId ?? null,
- actorGroupId: groupId ?? null,
- isActive: true
- },
- tx
- );
- await membershipRoleDAL.create({ membershipId: projectMembership.id, role: ProjectMembershipRole.Member }, tx);
+ // eslint-disable-next-line no-nested-ternary
+ const subjectLabel = userId ? "user" : identityId ? "machine identity" : "group";
+ throw new BadRequestError({
+ message: `This ${subjectLabel} can't be added here yet. Grant them access under Access Control first, then assign them to the application.`
+ });
}
const newMembership = await membershipDAL.create(
@@ -586,22 +550,39 @@ export const pkiApplicationMembershipServiceFactory = ({
});
const alreadyAttached = new Set<string>(existing.map((m) => m.actorUserId).filter((v): v is string => Boolean(v)));
- const targets: { userId: string; label: string }[] = [];
+ const candidates: { userId: string; label: string }[] = [];
const seen = new Set<string>();
userIds.forEach((id) => {
if (!seen.has(id)) {
seen.add(id);
- targets.push({ userId: id, label: id });
+ candidates.push({ userId: id, label: id });
}
});
emails.forEach((email) => {
const user = userByEmail.get(email);
if (user && !seen.has(user.id)) {
seen.add(user.id);
- targets.push({ userId: user.id, label: email });
+ candidates.push({ userId: user.id, label: email });
}
});
+ const candidateIds = candidates.map((t) => t.userId);
+ const projectMemberRows = candidateIds.length
+ ? await membershipDAL.find({
+ scope: AccessScope.Project,
+ scopeProjectId: projectId,
+ $in: { actorUserId: candidateIds }
+ })
+ : [];
+ const projectMemberIds = new Set(
+ projectMemberRows.map((m) => m.actorUserId).filter((v): v is string => Boolean(v))
+ );
+ const targets = candidates.filter((t) => {
+ if (projectMemberIds.has(t.userId)) return true;
+ unresolved.push(t.label);
+ return false;
+ });
+
const memberships: TApplicationMember[] = [];
const skipped: string[] = [];
for (const t of targets) {
diff --git a/docs/documentation/platform/pki/applications/overview.mdx b/docs/documentation/platform/pki/applications/overview.mdx
index 39b2778cfc..adbacc84fe 100644
--- a/docs/documentation/platform/pki/applications/overview.mdx
+++ b/docs/documentation/platform/pki/applications/overview.mdx
@@ -97,7 +97,7 @@ Members are assigned to Applications with one of three roles:
Yes. An Application can have multiple profiles attached, allowing you to issue different types of certificates (e.g., short-lived mTLS certs and longer-lived TLS certs) from the same Application.
</Accordion>
<Accordion title="How do I give another team access to my Application?">
- Go to your Application's **Members** tab and invite them with the appropriate role. They'll only have access to this specific Application, not other Applications in your organization.
+ Go to your Application's **Members** tab and add them with the appropriate role. They'll only have access to this specific Application, not other Applications in your organization.
</Accordion>
</AccordionGroup>
diff --git a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/AddApplicationMemberModal.tsx b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/AddApplicationMemberModal.tsx
index fa1461ebb4..ed30f5ad18 100644
--- a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/AddApplicationMemberModal.tsx
+++ b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/AddApplicationMemberModal.tsx
@@ -1,11 +1,9 @@
import { useMemo, useState } from "react";
import { HardDriveIcon, UserIcon, UsersIcon } from "lucide-react";
-import { z } from "zod";
import { createNotification } from "@app/components/notifications";
import { RoleOption } from "@app/components/roles";
import { FilterableSelect, FormControl } from "@app/components/v2";
-import { CreatableSelect } from "@app/components/v2/CreatableSelect";
import {
Button,
ButtonGroup,
@@ -16,22 +14,15 @@ import {
DialogHeader,
DialogTitle
} from "@app/components/v3";
-import { useOrganization } from "@app/context";
-import {
- useGetIdentityMembershipOrgs,
- useGetOrganizationGroups
-} from "@app/hooks/api/organization";
+import { useProject } from "@app/context";
import {
TPkiApplicationMember,
useAddPkiApplicationMember,
useAddPkiApplicationUserMembers
} from "@app/hooks/api/pkiApplications";
-import {
- useCreateProjectIdentityMembership,
- useListProjectIdentityMemberships
-} from "@app/hooks/api/projectIdentityMembership";
+import { useListProjectIdentityMemberships } from "@app/hooks/api/projectIdentityMembership";
+import { useGetWorkspaceUsers, useListWorkspaceGroups } from "@app/hooks/api/projects/queries";
import { ProjectType } from "@app/hooks/api/projects/types";
-import { useGetOrgUsers } from "@app/hooks/api/users";
type ActorType = "user" | "identity" | "group";
@@ -42,7 +33,7 @@ type Props = {
existingMembers: TPkiApplicationMember[];
};
-type Option = { value: string; label: string; isNew?: boolean };
+type Option = { value: string; label: string };
type AppRoleOption = { slug: string; name: string; description?: string };
@@ -73,14 +64,21 @@ const runSequential = async <T,>(items: T[], fn: (item: T) => Promise<void>): Pr
const NoUserOptions = () => (
<p>
- No matching org members. Type a full email to invite a new user — they&apos;ll receive an email
- and be added to this Application.
+ No matching project members. Grant users access from the Access Control page, then return here
+ to attach them to this Application.
</p>
);
const NoIdentityOptions = () => (
<p>
- No matching identities. Create machine identities from the Access Control page, then return here
+ No matching project identities. Grant machine identities access from the Access Control page,
+ then return here to attach them to this Application.
+ </p>
+);
+
+const NoGroupOptions = () => (
+ <p>
+ No matching project groups. Grant groups access from the Access Control page, then return here
to attach them to this Application.
</p>
);
@@ -91,8 +89,8 @@ export const AddApplicationMemberModal = ({
onOpenChange,
existingMembers
}: Props) => {
- const { currentOrg } = useOrganization();
- const orgId = currentOrg?.id ?? "";
+ const { currentProject } = useProject();
+ const projectId = currentProject?.id ?? "";
const [type, setType] = useState<ActorType>("user");
const [selectedUsers, setSelectedUsers] = useState<Option[]>([]);
@@ -101,23 +99,16 @@ export const AddApplicationMemberModal = ({
const [role, setRole] = useState("operator");
const [submitting, setSubmitting] = useState(false);
- const usersQuery = useGetOrgUsers(orgId);
- const identitiesQuery = useGetIdentityMembershipOrgs({ organizationId: orgId, limit: 100 });
- const groupsQuery = useGetOrganizationGroups(orgId);
-
- const projectIdentitiesQuery = useListProjectIdentityMemberships({
+ const usersQuery = useGetWorkspaceUsers(projectId);
+ const identitiesQuery = useListProjectIdentityMemberships({
projectId: "",
projectType: ProjectType.CertificateManager,
limit: 1000
});
- const identityIdsAlreadyInProject = useMemo(() => {
- const memberships = projectIdentitiesQuery.data?.identityMemberships ?? [];
- return new Set(memberships.map((m) => m.identity.id));
- }, [projectIdentitiesQuery.data]);
+ const groupsQuery = useListWorkspaceGroups(projectId, ProjectType.CertificateManager);
const addMember = useAddPkiApplicationMember();
const addUserMembers = useAddPkiApplicationUserMembers();
- const addIdentityToProject = useCreateProjectIdentityMembership();
const taken = useMemo(() => {
const set = new Set<string>();
@@ -151,10 +142,10 @@ export const AddApplicationMemberModal = ({
}, [identitiesQuery.data, taken]);
const groupOptions: Option[] = useMemo(() => {
- const groups = groupsQuery.data ?? [];
- return groups
- .filter((g) => !taken.has(`group:${g.id}`))
- .map((g) => ({ value: g.id, label: g.name }));
+ const memberships = groupsQuery.data ?? [];
+ return memberships
+ .filter((gm) => !taken.has(`group:${gm.group.id}`))
+ .map((gm) => ({ value: gm.group.id, label: gm.group.name }));
}, [groupsQuery.data, taken]);
const reset = () => {
@@ -180,47 +171,20 @@ export const AddApplicationMemberModal = ({
const submitUsers = async () => {
if (selectedUsers.length === 0) return;
+ const userIds = selectedUsers.map((u) => u.value);
- const userIds: string[] = [];
- const emails: string[] = [];
- selectedUsers.forEach((u) => {
- if (u.isNew) emails.push(u.value);
- else userIds.push(u.value);
- });
-
- const result = await addUserMembers.mutateAsync({
+ await addUserMembers.mutateAsync({
applicationId,
userIds,
- emails,
+ emails: [],
role
});
-
- if (result.unresolved.length > 0) {
- createNotification({
- type: "warning",
- text: `Couldn't resolve ${result.unresolved.length === 1 ? "user" : "users"}: ${result.unresolved.join(", ")}. They were invited to the org but not yet attached to the Application.`
- });
- }
};
const submitIdentities = async () => {
if (selectedIdentities.length === 0) return;
- const identityIds = selectedIdentities.map((item) => item.value);
-
- const idsNeedingProjectMembership = identityIds.filter(
- (id) => !identityIdsAlreadyInProject.has(id)
- );
- await runSequential(idsNeedingProjectMembership, async (identityId) => {
- await addIdentityToProject.mutateAsync({
- identityId,
- projectId: "",
- projectType: ProjectType.CertificateManager,
- role: "member"
- });
- });
-
- await runSequential(identityIds, async (identityId) => {
- await addMember.mutateAsync({ applicationId, kind: "identity", memberId: identityId, role });
+ await runSequential(selectedIdentities, async (item) => {
+ await addMember.mutateAsync({ applicationId, kind: "identity", memberId: item.value, role });
});
};
@@ -255,8 +219,6 @@ export const AddApplicationMemberModal = ({
{ value: "group", label: "Groups", icon: UsersIcon }
];
- const isEmail = (s: string) => z.string().email().safeParse(s).success;
-
const selectedByType: Record<ActorType, number> = {
user: selectedUsers.length,
identity: selectedIdentities.length,
@@ -270,8 +232,8 @@ export const AddApplicationMemberModal = ({
<DialogHeader>
<DialogTitle>Add Member</DialogTitle>
<DialogDescription>
- Grant access to this Application. Select existing org members, identities, or groups to
- attach. New machine identities must be created from the Access Control page.
+ Grant access to this Application. Select existing project members, identities, or groups
+ to attach. New members must first be granted access from the Access Control page.
</DialogDescription>
</DialogHeader>
@@ -299,22 +261,13 @@ export const AddApplicationMemberModal = ({
{type === "user" && (
<FormControl label="Users">
- <CreatableSelect
+ <FilterableSelect
isMulti
isLoading={usersQuery.isPending}
options={userOptions}
value={selectedUsers}
onChange={(v) => setSelectedUsers((v ?? []) as Option[])}
- placeholder="Select users or type an email…"
- onCreateOption={(input) => {
- if (!isEmail(input)) return;
- setSelectedUsers((prev) => [
- ...prev,
- { value: input, label: input, isNew: true }
- ]);
- }}
- isValidNewOption={(input) => isEmail(input)}
- formatCreateLabel={(input) => `Invite "${input}"`}
+ placeholder="Select existing project members…"
noOptionsMessage={NoUserOptions}
/>
</FormControl>
@@ -343,6 +296,7 @@ export const AddApplicationMemberModal = ({
value={selectedGroups}
onChange={(v) => setSelectedGroups((v ?? []) as Option[])}
placeholder="Select groups…"
+ noOptionsMessage={NoGroupOptions}
/>
</FormControl>
)}