diff --git a/app/components/Layout/Navigation.tsx b/app/components/Layout/Navigation.tsx index d922267a47..6529daee86 100644 --- a/app/components/Layout/Navigation.tsx +++ b/app/components/Layout/Navigation.tsx @@ -39,19 +39,19 @@ const Navigation: React.FC = ({ {userProfileComponent} - ) : router.pathname === "/" ? ( - isLoggedIn ) : ( -
- - {showExternalOperatorsLogin && } -
+ router.pathname !== "/" && ( +
+ + {showExternalOperatorsLogin && } +
+ ) ); const unauthorizedIdir = title === "Access required"; diff --git a/app/components/Session/LoginForm.tsx b/app/components/Session/LoginForm.tsx index 7ac78fcac1..124f0f2e9a 100644 --- a/app/components/Session/LoginForm.tsx +++ b/app/components/Session/LoginForm.tsx @@ -9,33 +9,30 @@ interface Props { const LoginForm: React.FC = ({ isExternal }) => { const router = useRouter(); - let loginURI = isExternal - ? `/login?redirectTo=${getExternalUserLandingPageRoute().pathname}` - : "/login"; + let loginURI = "/login"; if (router.query.redirectTo) loginURI += `?redirectTo=${encodeURIComponent( router.query.redirectTo as string )}`; + else if (isExternal) + loginURI += `?redirectTo=${encodeURIComponent( + getExternalUserLandingPageRoute().pathname as string + )}`; return ( <>
- {isExternal && router.pathname.includes("login-redirect") ? ( - - ) : isExternal ? ( - - ) : router.pathname.includes("login-redirect") ? ( - - ) : ( - - )} +