mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-01 10:11:50 +02:00
📈 Set name and email on login and register events (#1210)
Signed-off-by: Luke Vella <me@lukevella.com>
This commit is contained in:
parent
ffb4922084
commit
c126cbdda1
2 changed files with 12 additions and 2 deletions
|
@ -70,7 +70,12 @@ export const RegisterForm = () => {
|
||||||
|
|
||||||
queryClient.invalidate();
|
queryClient.invalidate();
|
||||||
|
|
||||||
posthog?.identify(res.user.id);
|
posthog?.identify(res.user.id, {
|
||||||
|
$set: {
|
||||||
|
email: res.user.email,
|
||||||
|
name: res.user.name,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
signIn("registration-token", {
|
signIn("registration-token", {
|
||||||
token,
|
token,
|
||||||
|
|
|
@ -28,7 +28,12 @@ export const LoginPage = ({ magicLink, email }: PageProps) => {
|
||||||
const updatedSession = await session.update();
|
const updatedSession = await session.update();
|
||||||
if (updatedSession) {
|
if (updatedSession) {
|
||||||
// identify the user in posthog
|
// 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();
|
await trpcUtils.invalidate();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue