From cfc338c5f0677dfcf32c107403d4da54a0f26e54 Mon Sep 17 00:00:00 2001 From: Pravesh Sharma Date: Tue, 12 Sep 2023 11:40:34 +0530 Subject: [PATCH] Fix an issue where login form doesn't appear if internal auth source is removed. #6378 --- web/pgadmin/static/js/SecurityPages/LoginPage.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/pgadmin/static/js/SecurityPages/LoginPage.jsx b/web/pgadmin/static/js/SecurityPages/LoginPage.jsx index d286f7410..b8473ce1e 100644 --- a/web/pgadmin/static/js/SecurityPages/LoginPage.jsx +++ b/web/pgadmin/static/js/SecurityPages/LoginPage.jsx @@ -8,7 +8,10 @@ import PropTypes from 'prop-types'; export default function LoginPage({userLanguage, langOptions, forgotPassUrl, csrfToken, loginUrl, authSources, authSourcesEnum, oauth2Config, loginBanner, ...props}) { const [form, setForm] = useState(({email: '', password: '', language: userLanguage})); - const showLoginForm = authSources?.includes('internal'); + + // Hide login form if auth source is only oauth2 and/or kerberos. #5386 + const showLoginForm = !((authSources?.includes('oauth2') || authSources?.includes('kerberos')) && authSources?.length == 1 || (authSources?.includes('oauth2') + && authSources?.includes('kerberos')) && authSources?.length == 2); const onTextChange = (n, val)=>{ setForm((prev)=>({...prev, [n]: val}));