Skip to content

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

improvements: correct analytics and purge signup metric after consumption

Scott Wilson2c62dc8ef860
diff --git a/backend/src/server/routes/v3/signup-router.ts b/backend/src/server/routes/v3/signup-router.ts
index 2309fd9f70..563f1dbd1c 100644
--- a/backend/src/server/routes/v3/signup-router.ts
+++ b/backend/src/server/routes/v3/signup-router.ts
@@ -158,7 +158,7 @@ export const registerSignupRouter = async (server: FastifyZodProvider) => {
username: user.username,
email: user.email ?? "",
attributionSource: isInvitedUser ? "Team Invite" : bodyAttributionSource,
- signupMethod: isInvitedUser ? "invite" : "email"
+ signupMethod: isInvitedUser ? "invite" : authMethod
}
});
diff --git a/frontend/src/pages/auth/SelectOrgPage/route.tsx b/frontend/src/pages/auth/SelectOrgPage/route.tsx
index d18dfdaaf7..a0e20eeaa3 100644
--- a/frontend/src/pages/auth/SelectOrgPage/route.tsx
+++ b/frontend/src/pages/auth/SelectOrgPage/route.tsx
@@ -45,9 +45,18 @@ export const Route = createFileRoute("/_restrict-login-signup/login/select-organ
// Provider-verified OAuth signups complete server-side and land here directly, bypassing the
// signup page that normally pushes this conversion event. Fire it before any auto-select
// redirect so the common single-org case is still counted (cloud only).
- if (search.signup_completed && isInfisicalCloud()) {
- window.dataLayer = window.dataLayer || [];
- window.dataLayer.push({ event: "signup_completed" });
+ if (search.signup_completed) {
+ if (isInfisicalCloud()) {
+ window.dataLayer = window.dataLayer || [];
+ window.dataLayer.push({ event: "signup_completed" });
+ }
+ // Consume the one-shot param so refresh/back-nav can't re-fire the conversion event
+ // (search middlewares never run on the initial document load, so it must be stripped here).
+ throw redirect({
+ to: "/login/select-organization",
+ search: { ...search, signup_completed: undefined },
+ replace: true
+ });
}
// Skip auto-select for MFA pending or force flag