Skip to content

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

Merge remote-tracking branch 'origin/main' into devin/1773102788-posthog-identify-on-auth

Devin AIeae098770a48
diff --cc backend/src/server/routes/v1/sso-router.ts
index bb39b4e8c1,e9ffbad269..bd5c92080d
--- a/backend/src/server/routes/v1/sso-router.ts
+++ b/backend/src/server/routes/v1/sso-router.ts
@@@ -79,33 -79,15 +79,19 @@@ export const registerOauthMiddlewares
const googleDistinctId = user.username ?? user.email ?? "";
if (googleDistinctId) {
- void server.services.telemetry.identifyUser(googleDistinctId, {
- email: user.email ?? undefined,
- username: user.username,
- userId: user.id,
- firstName: user.firstName ?? undefined,
- lastName: user.lastName ?? undefined
- });
+ void server.services.telemetry.identifyUser(
+ googleDistinctId,
+ {
+ email: user.email ?? undefined,
+ username: user.username,
+ userId: user.id,
+ firstName: user.firstName ?? undefined,
+ lastName: user.lastName ?? undefined
+ },
+ { skipDedup: true }
+ );
}
- if (!isUserCompleted && googleDistinctId) {
- void server.services.telemetry.sendPostHogEvents({
- event: PostHogEventTypes.UserSignedUp,
- distinctId: googleDistinctId,
- ...(orgId ? { organizationId: orgId } : {}),
- ...(orgName ? { organizationName: orgName } : {}),
- properties: {
- username: user.username,
- email: user.email ?? "",
- attributionSource: "Google OAuth"
- }
- });
- }
-
if (appCfg.OTEL_TELEMETRY_COLLECTION_ENABLED) {
authAttemptCounter.add(1, {
"infisical.user.email": email,
@@@ -179,33 -162,15 +166,19 @@@
const githubDistinctId = user.username ?? user.email ?? "";
if (githubDistinctId) {
- void server.services.telemetry.identifyUser(githubDistinctId, {
- email: user.email ?? undefined,
- username: user.username,
- userId: user.id,
- firstName: user.firstName ?? undefined,
- lastName: user.lastName ?? undefined
- });
+ void server.services.telemetry.identifyUser(
+ githubDistinctId,
+ {
+ email: user.email ?? undefined,
+ username: user.username,
+ userId: user.id,
+ firstName: user.firstName ?? undefined,
+ lastName: user.lastName ?? undefined
+ },
+ { skipDedup: true }
+ );
}
- if (!isUserCompleted && githubDistinctId) {
- void server.services.telemetry.sendPostHogEvents({
- event: PostHogEventTypes.UserSignedUp,
- distinctId: githubDistinctId,
- ...(orgId ? { organizationId: orgId } : {}),
- ...(orgName ? { organizationName: orgName } : {}),
- properties: {
- username: user.username,
- email: user.email ?? "",
- attributionSource: "GitHub OAuth"
- }
- });
- }
-
if (appCfg.OTEL_TELEMETRY_COLLECTION_ENABLED) {
authAttemptCounter.add(1, {
"infisical.user.email": email,
@@@ -271,33 -237,15 +245,19 @@@
const gitlabDistinctId = user.username ?? user.email ?? "";
if (gitlabDistinctId) {
- void server.services.telemetry.identifyUser(gitlabDistinctId, {
- email: user.email ?? undefined,
- username: user.username,
- userId: user.id,
- firstName: user.firstName ?? undefined,
- lastName: user.lastName ?? undefined
- });
+ void server.services.telemetry.identifyUser(
+ gitlabDistinctId,
+ {
+ email: user.email ?? undefined,
+ username: user.username,
+ userId: user.id,
+ firstName: user.firstName ?? undefined,
+ lastName: user.lastName ?? undefined
+ },
+ { skipDedup: true }
+ );
}
- if (!isUserCompleted && gitlabDistinctId) {
- void server.services.telemetry.sendPostHogEvents({
- event: PostHogEventTypes.UserSignedUp,
- distinctId: gitlabDistinctId,
- ...(orgId ? { organizationId: orgId } : {}),
- ...(orgName ? { organizationName: orgName } : {}),
- properties: {
- username: user.username,
- email: user.email ?? "",
- attributionSource: "GitLab OAuth"
- }
- });
- }
-
if (appCfg.OTEL_TELEMETRY_COLLECTION_ENABLED) {
authAttemptCounter.add(1, {
"infisical.user.email": email,