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

Signed-off-by: Luke Vella <me@lukevella.com>
This commit is contained in:
Luke Vella 2024-07-20 22:03:57 +01:00 committed by GitHub
parent ffb4922084
commit c126cbdda1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 2 deletions

View file

@ -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,

View file

@ -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();
}