Skip to content

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

exclude deleted projects from the honey token limit count

DimitrisStaratzisd2dc4dc57b84
diff --git a/backend/src/ee/services/honey-token/honey-token-dal.ts b/backend/src/ee/services/honey-token/honey-token-dal.ts
index a2163063b8..7e73c62830 100644
--- a/backend/src/ee/services/honey-token/honey-token-dal.ts
+++ b/backend/src/ee/services/honey-token/honey-token-dal.ts
@@ -94,6 +94,7 @@ export const honeyTokenDALFactory = (db: TDbClient) => {
const [result] = await (tx || db.replicaNode())(TableName.HoneyToken)
.join(TableName.Project, `${TableName.HoneyToken}.projectId`, `${TableName.Project}.id`)
.where(`${TableName.Project}.orgId`, orgId)
+ .whereNull(`${TableName.Project}.deleteAfter`)
.whereNot(`${TableName.HoneyToken}.status`, "revoked")
.count<{ count: string | number }>({
count: `${TableName.HoneyToken}.id`