diff --git a/src/client-scopes/details/ScopeForm.tsx b/src/client-scopes/details/ScopeForm.tsx index deb3538af6..19a4a91fa7 100644 --- a/src/client-scopes/details/ScopeForm.tsx +++ b/src/client-scopes/details/ScopeForm.tsx @@ -78,7 +78,11 @@ export const ScopeForm = ({ clientScope, save }: ScopeFormProps) => { helperTextInvalid={t("common:required")} > + !!value.trim() || t("common:required").toString(), + })} type="text" id="kc-name" name="name" diff --git a/src/client-scopes/form/ClientScopeForm.tsx b/src/client-scopes/form/ClientScopeForm.tsx index 8862a48860..e006105d14 100644 --- a/src/client-scopes/form/ClientScopeForm.tsx +++ b/src/client-scopes/form/ClientScopeForm.tsx @@ -106,7 +106,7 @@ export default function ClientScopeForm() { const save = async (clientScopes: ClientScopeDefaultOptionalType) => { try { - clientScopes.name = clientScopes.name?.trim(); + clientScopes.name = clientScopes.name?.trim().replace(/ /g, "_"); clientScopes = convertFormValuesToObject( clientScopes ) as ClientScopeDefaultOptionalType;