File tree Expand file tree Collapse file tree 3 files changed +16
-8
lines changed
Expand file tree Collapse file tree 3 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -54,13 +54,11 @@ export function SignIn() {
5454 const defaultCloudRoute = getDefaultSignedInCloudRouteForUser ( data ) ;
5555
5656 const company = parseCompanyFromEmail ( data . email ) ;
57- if ( company ) {
58- reoClient ?. identify ?.( {
59- username : data . email ,
60- type : 'email' ,
61- company,
62- } ) ;
63- }
57+ reoClient ?. identify ?.( {
58+ username : data . email ,
59+ type : 'email' ,
60+ ...( company ? { company } : { } ) ,
61+ } ) ;
6462 await queryClient . invalidateQueries ( { queryKey : [ queryKeys . user ] , refetchType : 'none' } ) ;
6563 void router . invalidate ( ) ;
6664 await navigate ( { to : redirect ?. startsWith ( '/' ) ? redirect : defaultCloudRoute } ) ;
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ import { FormLabel } from '@/components/ui/form/FormLabel';
77import { FormMessage } from '@/components/ui/form/FormMessage' ;
88import { Input } from '@/components/ui/input' ;
99import { useSignUpMutation } from '@/features/auth/hooks/useSignUp' ;
10+ import { reoClient } from '@/integrations/reo/reo' ;
11+ import { parseCompanyFromEmail } from '@/lib/string/parseCompanyFromEmail' ;
1012import { zodRequireEmail } from '@/lib/zod/email' ;
1113import { zodRequirePassword } from '@/lib/zod/password' ;
1214import { zodResolver } from '@hookform/resolvers/zod' ;
@@ -73,6 +75,14 @@ export function SignUp() {
7375 onClick : ( ) => toast . dismiss ( ) ,
7476 } ,
7577 } ) ;
78+ const company = parseCompanyFromEmail ( userData . email ) ;
79+ reoClient ?. identify ?.( {
80+ username : userData . email ,
81+ type : 'email' ,
82+ firstname : userData . firstname ,
83+ lastname : userData . lastname ,
84+ ...( company ? { company } : { } ) ,
85+ } ) ;
7686 navigate ( { to : '/sign-in' } ) ;
7787 } ,
7888 } ) ;
Original file line number Diff line number Diff line change @@ -3,6 +3,6 @@ declare module 'reodotdev' {
33
44 export interface ReoClient {
55 init : null | ( ( { clientID : string } ) => ReoClient ) ;
6- identify : null | ( ( person : { username : string ; type : string ; company : string ; } ) => void ) ;
6+ identify : null | ( ( person : Record < string , unknown > ) => void ) ;
77 }
88}
You can’t perform that action at this time.
0 commit comments