@@ -7,48 +7,16 @@ export const getFunctionOverrides =
77 ( originalImp : RecipeInterface ) : RecipeInterface => ( {
88 ...originalImp ,
99 getRegisterOptions : async function ( input ) {
10- const response = await originalImp . getRegisterOptions ( input ) ;
11-
12- if ( response . status === "OK" ) {
13- onHandleEvent ( {
14- action : "REGISTER_OPTIONS" ,
15- } ) ;
16- }
17-
18- return response ;
10+ return await originalImp . getRegisterOptions ( input ) ;
1911 } ,
2012 getSignInOptions : async function ( input ) {
21- const response = await originalImp . getSignInOptions ( input ) ;
22-
23- if ( response . status === "OK" ) {
24- onHandleEvent ( {
25- action : "SIGN_IN_OPTIONS" ,
26- } ) ;
27- }
28-
29- return response ;
13+ return await originalImp . getSignInOptions ( input ) ;
3014 } ,
3115 signIn : async function ( input ) {
32- const response = await originalImp . signIn ( input ) ;
33-
34- if ( response . status === "OK" ) {
35- onHandleEvent ( {
36- action : "SIGN_IN" ,
37- } ) ;
38- }
39-
40- return response ;
16+ return await originalImp . signIn ( input ) ;
4117 } ,
4218 signUp : async function ( input ) {
43- const response = await originalImp . signUp ( input ) ;
44-
45- if ( response . status === "OK" ) {
46- onHandleEvent ( {
47- action : "SIGN_UP" ,
48- } ) ;
49- }
50-
51- return response ;
19+ return await originalImp . signUp ( input ) ;
5220 } ,
5321 getEmailExists : async function ( input ) {
5422 const response = await originalImp . getEmailExists ( input ) ;
@@ -63,26 +31,10 @@ export const getFunctionOverrides =
6331 return response ;
6432 } ,
6533 generateRecoverAccountToken : async function ( input ) {
66- const response = await originalImp . generateRecoverAccountToken ( input ) ;
67-
68- if ( response . status === "OK" ) {
69- onHandleEvent ( {
70- action : "GENERATE_RECOVER_ACCOUNT_TOKEN" ,
71- } ) ;
72- }
73-
74- return response ;
34+ return await originalImp . generateRecoverAccountToken ( input ) ;
7535 } ,
7636 recoverAccount : async function ( input ) {
77- const response = await originalImp . recoverAccount ( input ) ;
78-
79- if ( response . status === "OK" ) {
80- onHandleEvent ( {
81- action : "RECOVER_ACCOUNT" ,
82- } ) ;
83- }
84-
85- return response ;
37+ return await originalImp . recoverAccount ( input ) ;
8638 } ,
8739 registerCredential : async function ( input ) {
8840 const response = await originalImp . registerCredential ( input ) ;
@@ -109,11 +61,7 @@ export const getFunctionOverrides =
10961 registerCredentialWithSignUp : async function ( input ) {
11062 const response = await originalImp . registerCredentialWithSignUp ( input ) ;
11163
112- if ( response . status === "OK" ) {
113- onHandleEvent ( {
114- action : "REGISTER_CREDENTIAL_WITH_SIGN_UP" ,
115- } ) ;
116- } else if ( response . status === "FAILED_TO_REGISTER_USER" ) {
64+ if ( response . status === "FAILED_TO_REGISTER_USER" ) {
11765 onHandleEvent ( {
11866 action : "FAILED_TO_REGISTER_USER" ,
11967 } ) ;
@@ -122,25 +70,9 @@ export const getFunctionOverrides =
12270 return response ;
12371 } ,
12472 authenticateCredentialWithSignIn : async function ( input ) {
125- const response = await originalImp . authenticateCredentialWithSignIn ( input ) ;
126-
127- if ( response . status === "OK" ) {
128- onHandleEvent ( {
129- action : "AUTHENTICATE_CREDENTIAL_WITH_SIGN_IN" ,
130- } ) ;
131- }
132-
133- return response ;
73+ return await originalImp . authenticateCredentialWithSignIn ( input ) ;
13474 } ,
13575 registerCredentialWithRecoverAccount : async function ( input ) {
136- const response = await originalImp . registerCredentialWithRecoverAccount ( input ) ;
137-
138- if ( response . status === "OK" ) {
139- onHandleEvent ( {
140- action : "REGISTER_CREDENTIAL_WITH_RECOVER_ACCOUNT" ,
141- } ) ;
142- }
143-
144- return response ;
76+ return await originalImp . registerCredentialWithRecoverAccount ( input ) ;
14577 } ,
14678 } ) ;
0 commit comments