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:
@@ -1157,8 +1157,6 @@ async def update_ldap_server(
|
|||||||
"host",
|
"host",
|
||||||
"attribute_for_mail",
|
"attribute_for_mail",
|
||||||
"attribute_for_username",
|
"attribute_for_username",
|
||||||
"app_dn",
|
|
||||||
"app_dn_password",
|
|
||||||
"search_base",
|
"search_base",
|
||||||
]
|
]
|
||||||
for key in required_fields:
|
for key in required_fields:
|
||||||
@@ -1173,8 +1171,8 @@ async def update_ldap_server(
|
|||||||
request.app.state.config.LDAP_ATTRIBUTE_FOR_USERNAME = (
|
request.app.state.config.LDAP_ATTRIBUTE_FOR_USERNAME = (
|
||||||
form_data.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_DN = form_data.app_dn or ""
|
||||||
request.app.state.config.LDAP_APP_PASSWORD = form_data.app_dn_password
|
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_BASE = form_data.search_base
|
||||||
request.app.state.config.LDAP_SEARCH_FILTERS = form_data.search_filters
|
request.app.state.config.LDAP_SEARCH_FILTERS = form_data.search_filters
|
||||||
request.app.state.config.LDAP_USE_TLS = form_data.use_tls
|
request.app.state.config.LDAP_USE_TLS = form_data.use_tls
|
||||||
|
|||||||
@@ -542,7 +542,6 @@
|
|||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
class="w-full bg-transparent outline-hidden py-0.5"
|
class="w-full bg-transparent outline-hidden py-0.5"
|
||||||
required
|
|
||||||
placeholder={$i18n.t('Enter Application DN')}
|
placeholder={$i18n.t('Enter Application DN')}
|
||||||
bind:value={LDAP_SERVER.app_dn}
|
bind:value={LDAP_SERVER.app_dn}
|
||||||
/>
|
/>
|
||||||
@@ -554,6 +553,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<SensitiveInput
|
<SensitiveInput
|
||||||
placeholder={$i18n.t('Enter Application DN Password')}
|
placeholder={$i18n.t('Enter Application DN Password')}
|
||||||
|
required={false}
|
||||||
bind:value={LDAP_SERVER.app_dn_password}
|
bind:value={LDAP_SERVER.app_dn_password}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user