diff --git a/apps/schools/domains/user/components/auth/registerForm/index.tsx b/apps/schools/domains/user/components/auth/registerForm/index.tsx index 2bd20dd7..43967535 100644 --- a/apps/schools/domains/user/components/auth/registerForm/index.tsx +++ b/apps/schools/domains/user/components/auth/registerForm/index.tsx @@ -36,8 +36,10 @@ export const RegisterForm: React.FC = ({ onFinish, onError } const registerComplete = useCallback(() => { const { password } = form.getFieldsValue(['password']) - registrationHandler(phone, password, userRegistration, onError, form).then(async () => { - await getLazyUser({}) + registrationHandler(phone, password, userRegistration, onError, form).then(async (response) => { + if (!('error' in response)) { + await getLazyUser({}) + } }) }, [form, signInByPhone, getLazyUser]) diff --git a/apps/schools/domains/user/handlers/auth/register.ts b/apps/schools/domains/user/handlers/auth/register.ts index 356a3ef0..f237cff9 100644 --- a/apps/schools/domains/user/handlers/auth/register.ts +++ b/apps/schools/domains/user/handlers/auth/register.ts @@ -109,6 +109,7 @@ export async function registrationHandler( }, ]) } + return response } export async function resendOtpHandler(recaptchaToken: string, resendOtpMutation: any, onError: () => void) {