From ab357704f8ce0a2f7de94603847f937fd850dbee Mon Sep 17 00:00:00 2001 From: Stanislav Lunyachek Date: Fri, 12 Apr 2024 11:07:07 +0300 Subject: [PATCH] feat: Hide preloaders for third party auth providers if they are disabled --- src/login/LoginPage.jsx | 3 ++- src/register/components/ThirdPartyAuth.jsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/login/LoginPage.jsx b/src/login/LoginPage.jsx index 52ab010182..7b0a08f3c7 100644 --- a/src/login/LoginPage.jsx +++ b/src/login/LoginPage.jsx @@ -166,6 +166,7 @@ class LoginPage extends React.Component { const isInstitutionAuthActive = !!secondaryProviders.length && !currentProvider; const isSocialAuthActive = !!providers.length && !currentProvider; const isEnterpriseLoginDisabled = getConfig().DISABLE_ENTERPRISE_LOGIN; + const isThirdPartyAuthActive = isSocialAuthActive || (isEnterpriseLoginDisabled && isInstitutionAuthActive); return ( <> @@ -183,7 +184,7 @@ class LoginPage extends React.Component { )} - {thirdPartyAuthApiStatus === PENDING_STATE ? ( + {thirdPartyAuthApiStatus === PENDING_STATE && isThirdPartyAuthActive ? ( ) : ( <> diff --git a/src/register/components/ThirdPartyAuth.jsx b/src/register/components/ThirdPartyAuth.jsx index 3a8682488c..0d447287d3 100644 --- a/src/register/components/ThirdPartyAuth.jsx +++ b/src/register/components/ThirdPartyAuth.jsx @@ -25,6 +25,7 @@ const ThirdPartyAuth = (props) => { const isInstitutionAuthActive = !!secondaryProviders.length && !currentProvider; const isSocialAuthActive = !!providers.length && !currentProvider; const isEnterpriseLoginDisabled = getConfig().DISABLE_ENTERPRISE_LOGIN; + const isThirdPartyAuthActive = isSocialAuthActive || (isEnterpriseLoginDisabled && isInstitutionAuthActive); return ( <> @@ -34,7 +35,7 @@ const ThirdPartyAuth = (props) => { )} - {thirdPartyAuthApiStatus === PENDING_STATE ? ( + {thirdPartyAuthApiStatus === PENDING_STATE && isThirdPartyAuthActive ? ( ) : ( <>