From b32b0939b18435be7e0869a26a39dafc4881382f Mon Sep 17 00:00:00 2001 From: gbuomprisco Date: Fri, 6 Sep 2024 18:37:09 +0200 Subject: [PATCH] Only emit sign up event when the property "shouldCreateUser" is truthy --- .../src/components/magic-link-auth-container.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/features/auth/src/components/magic-link-auth-container.tsx b/packages/features/auth/src/components/magic-link-auth-container.tsx index 7ab2b34bf..6e43d7414 100644 --- a/packages/features/auth/src/components/magic-link-auth-container.tsx +++ b/packages/features/auth/src/components/magic-link-auth-container.tsx @@ -77,12 +77,14 @@ export function MagicLinkAuthContainer({ }, }); - appEvents.emit({ - type: 'user.signedUp', - payload: { - method: 'magiclink', - }, - }); + if (shouldCreateUser) { + appEvents.emit({ + type: 'user.signedUp', + payload: { + method: 'magiclink', + }, + }); + } }; toast.promise(promise, {