Skip to content

Commit

Permalink
Keep correct format of config fields
Browse files Browse the repository at this point in the history
Fixes: #29314

Signed-off-by: Hynek Mlnarik <hmlnarik@redhat.com>
(cherry picked from commit ef4a246)
  • Loading branch information
hmlnarik committed May 15, 2024
1 parent 2c397d7 commit 3fb06c0
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,12 @@ export default function DetailSettings() {

const save = async (savedProvider?: IdentityProviderRepresentation) => {
const p = savedProvider || getValues();
const origAuthnContextClassRefs = p.config?.authnContextClassRefs;
if (p.config?.authnContextClassRefs)
p.config.authnContextClassRefs = JSON.stringify(
p.config.authnContextClassRefs,
);
const origAuthnContextDeclRefs = p.config?.authnContextDeclRefs;
if (p.config?.authnContextDeclRefs)
p.config.authnContextDeclRefs = JSON.stringify(
p.config.authnContextDeclRefs,
Expand All @@ -342,6 +344,12 @@ export default function DetailSettings() {
providerId,
},
);
if (origAuthnContextClassRefs) {
p.config!.authnContextClassRefs = origAuthnContextClassRefs;
}
if (origAuthnContextDeclRefs) {
p.config!.authnContextDeclRefs = origAuthnContextDeclRefs;
}
reset(p);
addAlert(t("updateSuccessIdentityProvider"), AlertVariant.success);
} catch (error) {
Expand Down

0 comments on commit 3fb06c0

Please sign in to comment.