diff --git a/public/app/features/admin/ldap/LdapSettingsPage.tsx b/public/app/features/admin/ldap/LdapSettingsPage.tsx index 1132b95265f..7621a3fb94a 100644 --- a/public/app/features/admin/ldap/LdapSettingsPage.tsx +++ b/public/app/features/admin/ldap/LdapSettingsPage.tsx @@ -20,6 +20,7 @@ import { TextLink, Dropdown, MultiSelect, + SecretInput, } from '@grafana/ui'; import { FormPrompt } from 'app/core/components/FormPrompt/FormPrompt'; import { Page } from 'app/core/components/Page/Page'; @@ -98,6 +99,7 @@ export const LdapSettingsPage = () => { const [isLoading, setIsLoading] = useState(true); const [isDrawerOpen, setIsDrawerOpen] = useState(false); + const [isBindPasswordConfigured, setBindPasswordConfigured] = useState(false); const [mapKeyCertConfigured, setMapKeyCertConfigured] = useState({ // values rootCaCertValue: false, @@ -114,6 +116,7 @@ export const LdapSettingsPage = () => { control, formState: { isDirty }, getValues, + setValue, handleSubmit, register, reset, @@ -137,6 +140,7 @@ export const LdapSettingsPage = () => { clientCertPath: isOptionDefined(serverConfig.client_cert), clientKeyCertPath: isOptionDefined(serverConfig.client_key), }); + setBindPasswordConfigured(isOptionDefined(serverConfig.bind_password)); reset(payload); setIsLoading(false); @@ -325,10 +329,15 @@ export const LdapSettingsPage = () => { /> - { + setValue(`${serverConfig}.bind_password`, ''); + setBindPasswordConfigured(false); + }} + value={watch(`${serverConfig}.bind_password`)} + onChange={({ currentTarget: { value } }) => setValue(`${serverConfig}.bind_password`, value)} />