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