Skip to content

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

update secrets posthog event logic

Maidul Islam293a62b63278
diff --git a/backend/src/controllers/v2/secretsController.ts b/backend/src/controllers/v2/secretsController.ts
index bbc5d52903..bf6cd9fc1e 100644
--- a/backend/src/controllers/v2/secretsController.ts
+++ b/backend/src/controllers/v2/secretsController.ts
@@ -973,7 +973,7 @@ export const getSecrets = async (req: Request, res: Response) => {
// reduce the number of events captured
let shouldRecordK8Event = false
- if (req.authData instanceof ServiceTokenData && req.authData.userAgent == K8_USER_AGENT_NAME) {
+ if (req.authData.userAgent == K8_USER_AGENT_NAME) {
const randomNumber = Math.random();
if (randomNumber > 0.9) {
shouldRecordK8Event = true
diff --git a/backend/src/helpers/secrets.ts b/backend/src/helpers/secrets.ts
index 0d9efbcd70..2a05ce196e 100644
--- a/backend/src/helpers/secrets.ts
+++ b/backend/src/helpers/secrets.ts
@@ -571,7 +571,7 @@ export const getSecretsHelper = async ({
// reduce the number of events captured
let shouldRecordK8Event = false
- if (authData instanceof ServiceTokenData && authData.userAgent == K8_USER_AGENT_NAME) {
+ if (authData.userAgent == K8_USER_AGENT_NAME) {
const randomNumber = Math.random();
if (randomNumber > 0.9) {
shouldRecordK8Event = true