fix: allow admins to uncheck disallow password if applicable (#4532)

- closes #4469
This commit is contained in:
Amir Ehsandar 2025-03-18 04:30:50 +03:30 committed by GitHub
parent 9b957edd1f
commit 7b23bdcfcf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -128,7 +128,10 @@ const WorkspaceSection = () => {
<div className="w-full flex flex-row justify-between items-center">
<span>{t("setting.workspace-section.disallow-password-auth")}</span>
<Switch
disabled={workspaceStore.state.profile.mode === "demo" || identityProviderList.length === 0}
disabled={
workspaceStore.state.profile.mode === "demo" ||
(identityProviderList.length === 0 && !workspaceGeneralSetting.disallowPasswordAuth)
}
checked={workspaceGeneralSetting.disallowPasswordAuth}
onChange={(event) => updatePartialSetting({ disallowPasswordAuth: event.target.checked })}
/>