Login: Ldap: fix display wrong placeholder on disabled LDAP settings

This commit is contained in:
Alexey Safronov 2024-08-12 18:56:12 +04:00
parent 7f2b4c9686
commit b614938b2b
2 changed files with 4 additions and 6 deletions

View File

@ -70,7 +70,7 @@ async function Page() {
reCaptchaPublicKey={settings?.recaptchaPublicKey}
reCaptchaType={settings?.recaptchaType}
ldapDomain={capabilities?.ldapDomain}
ldapEnabled={capabilities?.ldapEnabled}
ldapEnabled={capabilities?.ldapEnabled || false}
/>
<ThirdParty
thirdParty={thirdParty}

View File

@ -112,7 +112,9 @@ const LoginForm = ({
const [password, setPassword] = useState("");
const [isChecked, setIsChecked] = useState(false);
const [isLdapLoginChecked, setIsLdapLoginChecked] = useState(!!ldapDomain);
const [isLdapLoginChecked, setIsLdapLoginChecked] = useState(
ldapEnabled || false,
);
const [isCaptcha, setIsCaptcha] = useState(false);
const [isCaptchaSuccessful, setIsCaptchaSuccess] = useState(false);
const [isCaptchaError, setIsCaptchaError] = useState(false);
@ -171,10 +173,6 @@ const LoginForm = ({
[t, referenceUrl, currentCulture],
);
useEffect(() => {
setIsLdapLoginChecked(!!ldapDomain);
}, [ldapDomain]);
useEffect(() => {
const profile = localStorage.getItem("profile");
if (!profile) return;