Convert claims back to object (#3363)

This commit is contained in:
Erik Jan de Wit 2022-09-21 16:52:42 +02:00 committed by GitHub
parent 6c57312273
commit aa7acda01e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -69,9 +69,7 @@ export default function AddMapper() {
useState<IdentityProviderMapperTypeRepresentation>(); useState<IdentityProviderMapperTypeRepresentation>();
const save = async (idpMapper: IdentityProviderMapperRepresentation) => { const save = async (idpMapper: IdentityProviderMapperRepresentation) => {
const mapper = convertFormValuesToObject( const mapper = convertFormValuesToObject(idpMapper);
idpMapper
) as IdentityProviderMapperRepresentation;
const attributes = JSON.stringify(idpMapper.config.attributes ?? []); const attributes = JSON.stringify(idpMapper.config.attributes ?? []);
const claims = JSON.stringify(idpMapper.config.claims ?? []); const claims = JSON.stringify(idpMapper.config.claims ?? []);
@ -171,6 +169,7 @@ export default function AddMapper() {
"config.attributes", "config.attributes",
JSON.parse(mapper.config.attributes || "{}") JSON.parse(mapper.config.attributes || "{}")
); );
form.setValue("config.claims", JSON.parse(mapper.config.claims || "{}"));
}; };
if (!mapperTypes || !currentMapper) { if (!mapperTypes || !currentMapper) {