Shun Miyazawa 3 лет назад
Родитель
Сommit
e373fdd77c
1 измененных файлов с 4 добавлено и 8 удалено
  1. 4 8
      packages/app/src/components/LoginForm.tsx

+ 4 - 8
packages/app/src/components/LoginForm.tsx

@@ -289,12 +289,10 @@ export const LoginForm = (props: LoginFormProps): JSX.Element => {
       setIsSuccessToRagistration(true);
       setIsSuccessToRagistration(true);
       resetRegisterErrors();
       resetRegisterErrors();
 
 
-      if (registrationMode === RegistrationMode.RESTRICTED) {
-        return;
-      }
-
       const { redirectTo } = res.data;
       const { redirectTo } = res.data;
-      router.push(redirectTo ?? '/');
+      if (redirectTo != null) {
+        router.push(redirectTo);
+      }
 
 
       if (isEmailAuthenticationEnabled) {
       if (isEmailAuthenticationEnabled) {
         setEmailForRegistrationOrder(emailForRegister);
         setEmailForRegistrationOrder(emailForRegister);
@@ -308,9 +306,7 @@ export const LoginForm = (props: LoginFormProps): JSX.Element => {
       }
       }
     }
     }
     return;
     return;
-  }, [
-    usernameForRegister, nameForRegister, emailForRegister, passwordForRegister, resetRegisterErrors, router, isEmailAuthenticationEnabled, registrationMode,
-  ]);
+  }, [usernameForRegister, nameForRegister, emailForRegister, passwordForRegister, resetRegisterErrors, router, isEmailAuthenticationEnabled]);
 
 
   const switchForm = useCallback(() => {
   const switchForm = useCallback(() => {
     setIsRegistering(!isRegistering);
     setIsRegistering(!isRegistering);