Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

📈 Set name and email on login and register events (#1210)

Luke Vellac126cbdda1e4
diff --git a/apps/web/src/app/[locale]/(auth)/register/register-page.tsx b/apps/web/src/app/[locale]/(auth)/register/register-page.tsx
index 3bbc2f394..0c8667436 100644
--- a/apps/web/src/app/[locale]/(auth)/register/register-page.tsx
+++ b/apps/web/src/app/[locale]/(auth)/register/register-page.tsx
@@ -70,7 +70,12 @@ export const RegisterForm = () => {
queryClient.invalidate();
- posthog?.identify(res.user.id);
+ posthog?.identify(res.user.id, {
+ $set: {
+ email: res.user.email,
+ name: res.user.name,
+ },
+ });
signIn("registration-token", {
token,
diff --git a/apps/web/src/app/[locale]/auth/login/login-page.tsx b/apps/web/src/app/[locale]/auth/login/login-page.tsx
index 2f3484f6d..f5f8d9ecc 100644
--- a/apps/web/src/app/[locale]/auth/login/login-page.tsx
+++ b/apps/web/src/app/[locale]/auth/login/login-page.tsx
@@ -28,7 +28,12 @@ export const LoginPage = ({ magicLink, email }: PageProps) => {
const updatedSession = await session.update();
if (updatedSession) {
// identify the user in posthog
- posthog?.identify(updatedSession.user.id);
+ posthog?.identify(updatedSession.user.id, {
+ $set: {
+ email: updatedSession.user.email,
+ name: updatedSession.user.name,
+ },
+ });
await trpcUtils.invalidate();
}