Skip to content

Commit f8ef4c2

Browse files
committed
fix: update scope undefined value
1 parent a825149 commit f8ef4c2

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

admin-ui/plugins/auth-server/components/Scopes/ScopeForm.js

+10-3
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ function ScopeForm({ scope, scripts, attributes, handleSubmit }) {
111111
result['attributes'].spontaneousClientId =
112112
scope.attributes.spontaneousClientId
113113
result['attributes'].spontaneousClientScopes =
114-
scope.spontaneousClientScopes
114+
scope.spontaneousClientScopes ||
115+
scope.attributes.spontaneousClientScopes
115116
handleSubmit(JSON.stringify(result))
116117
}}
117118
>
@@ -308,10 +309,16 @@ function ScopeForm({ scope, scripts, attributes, handleSubmit }) {
308309
formik={formik}
309310
value={getMapping(
310311
spontaneousClientScopes,
311-
scope.attributes.spontaneousClientScopes.map((item) => ({ dn: item || "", name: item || ""})),
312+
scope?.attributes?.spontaneousClientScopes?.map((item) => ({
313+
dn: item || '',
314+
name: item || '',
315+
})),
312316
)}
313317
allowNew={true}
314-
options={spontaneousClientScopes.map((item) => ({ dn: item || "", name: item || "" }))}
318+
options={spontaneousClientScopes?.map((item) => ({
319+
dn: item || '',
320+
name: item || '',
321+
}))}
315322
doc_category={SCOPE}
316323
/>
317324
</Accordion.Body>

0 commit comments

Comments
 (0)