Use correct default for 'Truststore SPI' (#980)

This commit is contained in:
Jon Koops 2021-08-11 07:52:12 +02:00 committed by GitHub
parent 9849c87270
commit dbedd79883
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -165,8 +165,8 @@ export const LdapSettingsConnection = ({
> >
<Controller <Controller
name="config.useTruststoreSpi[0]" name="config.useTruststoreSpi[0]"
defaultValue=""
control={form.control} control={form.control}
defaultValue="ldapsOnly"
render={({ onChange, value }) => ( render={({ onChange, value }) => (
<Select <Select
toggleId="kc-use-truststore-spi" toggleId="kc-use-truststore-spi"
@ -175,21 +175,14 @@ export const LdapSettingsConnection = ({
} }
isOpen={isTruststoreSpiDropdownOpen} isOpen={isTruststoreSpiDropdownOpen}
onSelect={(_, value) => { onSelect={(_, value) => {
onChange(value as string); onChange(value.toString());
setIsTruststoreSpiDropdownOpen(false); setIsTruststoreSpiDropdownOpen(false);
}} }}
selections={value} selections={value}
variant={SelectVariant.single}
> >
<SelectOption key={0} value="always"> <SelectOption value="always">{t("always")}</SelectOption>
{t("always")} <SelectOption value="ldapsOnly">{t("onlyLdaps")}</SelectOption>
</SelectOption> <SelectOption value="never">{t("never")}</SelectOption>
<SelectOption key={1} value="ldapsOnly">
{t("onlyLdaps")}
</SelectOption>
<SelectOption key={2} value="never">
{t("never")}
</SelectOption>
</Select> </Select>
)} )}
></Controller> ></Controller>