Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

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

Amir Ehsandar7b23bdcfcf2c
diff --git a/web/src/components/Settings/WorkspaceSection.tsx b/web/src/components/Settings/WorkspaceSection.tsx
index 81a2b24a8..3337a12c4 100644
--- a/web/src/components/Settings/WorkspaceSection.tsx
+++ b/web/src/components/Settings/WorkspaceSection.tsx
@@ -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 })}
/>