Keep existing config we don't have fields for (#3639)

This commit is contained in:
Erik Jan de Wit 2022-10-25 19:52:17 +02:00 committed by GitHub
parent 44436f5935
commit 37afe07bd5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -162,8 +162,8 @@ export default function DetailSettings() {
[]
);
const save = async (provider?: IdentityProviderRepresentation) => {
const p = provider || getValues();
const save = async (savedProvider?: IdentityProviderRepresentation) => {
const p = savedProvider || getValues();
if (p.config?.authnContextClassRefs)
p.config.authnContextClassRefs = JSON.stringify(
p.config.authnContextClassRefs
@ -172,10 +172,16 @@ export default function DetailSettings() {
p.config.authnContextDeclRefs = JSON.stringify(
p.config.authnContextDeclRefs
);
try {
await adminClient.identityProviders.update(
{ alias },
{ ...p, alias, providerId }
{
...p,
config: { ...provider?.config, ...p.config },
alias,
providerId,
}
);
addAlert(t("updateSuccess"), AlertVariant.success);
} catch (error) {