From 7849331dd709644f2ee5fcbf5526b384efe77ac7 Mon Sep 17 00:00:00 2001 From: Muhsin Shah Date: Wed, 13 Mar 2024 09:25:45 +0530 Subject: [PATCH] Removed signup redirection --- frontend/src/Routes/AuthRoute.jsx | 12 +- frontend/src/SignupPage/SignupPage.jsx | 281 +++++++++++++------------ 2 files changed, 148 insertions(+), 145 deletions(-) diff --git a/frontend/src/Routes/AuthRoute.jsx b/frontend/src/Routes/AuthRoute.jsx index 276f7aeffc..8db80d6205 100644 --- a/frontend/src/Routes/AuthRoute.jsx +++ b/frontend/src/Routes/AuthRoute.jsx @@ -29,16 +29,8 @@ export const AuthRoute = ({ children, navigate }) => { useEffect( () => { - const isInviteFlow = !!location.state?.organizationToken; - const isSignUpRoute = location.pathname.startsWith('/signup'); - const shouldRedirectToSignup = isSignUpRoute && organizationSlug && !isInviteFlow; - if (shouldRedirectToSignup) { - /* workspace signup is now allowed only for invite flow */ - navigate('/signup'); - } else { - authenticationService.deleteAllAuthCookies(); - fetchOrganizationDetails(); - } + authenticationService.deleteAllAuthCookies(); + fetchOrganizationDetails(); }, // eslint-disable-next-line react-hooks/exhaustive-deps [location.pathname] diff --git a/frontend/src/SignupPage/SignupPage.jsx b/frontend/src/SignupPage/SignupPage.jsx index 938f89cdba..d83961b305 100644 --- a/frontend/src/SignupPage/SignupPage.jsx +++ b/frontend/src/SignupPage/SignupPage.jsx @@ -167,148 +167,159 @@ class SignupPageComponent extends React.Component { {this.props.t('loginSignupPage.signIn', `Sign in`)} - {shouldShowSignupDisabledCard && ( + {shouldShowSignupDisabledCard ? ( - )} - - {(configs?.enable_sign_up || !!this.organizationToken) && ( -
- {configs?.git?.enabled && ( -
- -
- )} - {configs?.google?.enabled && ( -
- -
- )} - {(configs?.git?.enabled || configs?.google?.enabled) && this.isFormSignUpEnabled() && ( -
-
-

- OR -

-
-
- )} -
- )} - {this.isFormSignUpEnabled() && ( + ) : ( <> -
- {!comingFromInviteFlow && ( - <> - - {' '} - - )} - - -
- -
- {this.state.showPassword ? ( - + {configs?.git?.enabled && ( +
+ - ) : ( - - )} -
- - {this.props.t( - 'loginSignupPage.passwordCharacter', - 'Password must be at least 5 characters' - )} - -
-
-
- - {isLoading ? ( -
-
- ) : ( - <> - - {this.props.t('loginSignupPage.getStartedForFree', 'Get started for free')} - - - )} -
-
+ {configs?.google?.enabled && ( +
+ +
+ )} + {(configs?.git?.enabled || configs?.google?.enabled) && this.isFormSignUpEnabled() && ( +
+
+

+ OR +

+
+
+ )} +
+ )} + {this.isFormSignUpEnabled() && ( + <> +
+ {!comingFromInviteFlow && ( + <> + + {' '} + + )} + + +
+ +
+ {this.state.showPassword ? ( + + ) : ( + + )} +
+ + {this.props.t( + 'loginSignupPage.passwordCharacter', + 'Password must be at least 5 characters' + )} + +
+
+
+ + {isLoading ? ( +
+ +
+ ) : ( + <> + + {this.props.t('loginSignupPage.getStartedForFree', 'Get started for free')} + + + + )} +
+
+ + )} )} +

By signing up you are agreeing to the