fix(ui): allow empty LDAP Application DN value and password in General setting… (#21742)

* Allow empty LDAP Application DN value and password in General settings form

* fix(ui): use LDAP app_dn, app_dn_password with empty string instead of enforcing non-empty values
This commit is contained in:
Johann Frei
2026-02-22 17:58:12 -06:00
committed by GitHub
parent d1b39da911
commit 4b3543d3c0
2 changed files with 3 additions and 5 deletions
+2 -4
View File
@@ -1157,8 +1157,6 @@ async def update_ldap_server(
"host",
"attribute_for_mail",
"attribute_for_username",
"app_dn",
"app_dn_password",
"search_base",
]
for key in required_fields:
@@ -1173,8 +1171,8 @@ async def update_ldap_server(
request.app.state.config.LDAP_ATTRIBUTE_FOR_USERNAME = (
form_data.attribute_for_username
)
request.app.state.config.LDAP_APP_DN = form_data.app_dn
request.app.state.config.LDAP_APP_PASSWORD = form_data.app_dn_password
request.app.state.config.LDAP_APP_DN = form_data.app_dn or ""
request.app.state.config.LDAP_APP_PASSWORD = form_data.app_dn_password or ""
request.app.state.config.LDAP_SEARCH_BASE = form_data.search_base
request.app.state.config.LDAP_SEARCH_FILTERS = form_data.search_filters
request.app.state.config.LDAP_USE_TLS = form_data.use_tls
@@ -542,7 +542,6 @@
>
<input
class="w-full bg-transparent outline-hidden py-0.5"
required
placeholder={$i18n.t('Enter Application DN')}
bind:value={LDAP_SERVER.app_dn}
/>
@@ -554,6 +553,7 @@
</div>
<SensitiveInput
placeholder={$i18n.t('Enter Application DN Password')}
required={false}
bind:value={LDAP_SERVER.app_dn_password}
/>
</div>