Skip to content

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

Clarify error message for delete protection

Maidul Islam8362e518f11f
diff --git a/backend/src/services/identity-v2/identity-service.ts b/backend/src/services/identity-v2/identity-service.ts
index f86fe5ebd6..a0b3bb4a5b 100644
--- a/backend/src/services/identity-v2/identity-service.ts
+++ b/backend/src/services/identity-v2/identity-service.ts
@@ -203,7 +203,7 @@ export const identityV2ServiceFactory = ({
if (!existingIdentity)
throw new NotFoundError({ message: `Identity with id ${dto.selector.identityId} not found` });
if (existingIdentity.hasDeleteProtection) {
- throw new BadRequestError({ message: "Identity has delete protection" });
+ throw new BadRequestError({ message: "Cannot delete identity while delete protection is enabled" });
}
const deletedIdentity = await identityDAL.deleteById(dto.selector.identityId);