Fix an issue where login form doesn't appear if internal auth source is removed. #6378

pull/6752/head
Pravesh Sharma 2023-09-12 11:40:34 +05:30 committed by GitHub
parent 32403920fe
commit cfc338c5f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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}));