mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
fix: add custom slug check to user
This commit is contained in:
@@ -185,7 +185,7 @@ export const identityProjectServiceFactory = ({
|
|||||||
({ role }) =>
|
({ role }) =>
|
||||||
!Object.values(ProjectMembershipRole)
|
!Object.values(ProjectMembershipRole)
|
||||||
// we don't want to include custom in this check;
|
// we don't want to include custom in this check;
|
||||||
// this unintentionally lets users set slug to custom which is reserved
|
// this unintentionally enables setting slug to custom which is reserved
|
||||||
.filter((r) => r !== ProjectMembershipRole.Custom)
|
.filter((r) => r !== ProjectMembershipRole.Custom)
|
||||||
.includes(role as ProjectMembershipRole)
|
.includes(role as ProjectMembershipRole)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -280,7 +280,12 @@ export const projectMembershipServiceFactory = ({
|
|||||||
|
|
||||||
// validate custom roles input
|
// validate custom roles input
|
||||||
const customInputRoles = roles.filter(
|
const customInputRoles = roles.filter(
|
||||||
({ role }) => !Object.values(ProjectMembershipRole).includes(role as ProjectMembershipRole)
|
({ role }) =>
|
||||||
|
!Object.values(ProjectMembershipRole)
|
||||||
|
// we don't want to include custom in this check;
|
||||||
|
// this unintentionally enables setting slug to custom which is reserved
|
||||||
|
.filter((r) => r !== ProjectMembershipRole.Custom)
|
||||||
|
.includes(role as ProjectMembershipRole)
|
||||||
);
|
);
|
||||||
const hasCustomRole = Boolean(customInputRoles.length);
|
const hasCustomRole = Boolean(customInputRoles.length);
|
||||||
if (hasCustomRole) {
|
if (hasCustomRole) {
|
||||||
|
|||||||
Reference in New Issue
Block a user