remove userProfileMetadata from user (#25608)
fixes: #25463 Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
This commit is contained in:
parent
dd90ffccaf
commit
01e7a58aa4
1 changed files with 5 additions and 4 deletions
|
@ -103,13 +103,13 @@ export default function EditUser() {
|
||||||
adminClient.users.findOne({
|
adminClient.users.findOne({
|
||||||
id: id!,
|
id: id!,
|
||||||
userProfileMetadata: true,
|
userProfileMetadata: true,
|
||||||
}) as UIUserRepresentation,
|
}) as UIUserRepresentation | undefined,
|
||||||
adminClient.attackDetection.findOne({ id: id! }),
|
adminClient.attackDetection.findOne({ id: id! }),
|
||||||
getUnmanagedAttributes(id!),
|
getUnmanagedAttributes(id!),
|
||||||
adminClient.users.getProfile({ realm: realmName }),
|
adminClient.users.getProfile({ realm: realmName }),
|
||||||
]),
|
]),
|
||||||
([realm, user, attackDetection, unmanagedAttributes, upConfig]) => {
|
([realm, userData, attackDetection, unmanagedAttributes, upConfig]) => {
|
||||||
if (!user || !realm || !attackDetection) {
|
if (!userData || !realm || !attackDetection) {
|
||||||
throw new Error(t("notFound"));
|
throw new Error(t("notFound"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,8 +117,9 @@ export default function EditUser() {
|
||||||
isFeatureEnabled(Feature.DeclarativeUserProfile) &&
|
isFeatureEnabled(Feature.DeclarativeUserProfile) &&
|
||||||
realm.attributes?.userProfileEnabled === "true";
|
realm.attributes?.userProfileEnabled === "true";
|
||||||
|
|
||||||
|
const { userProfileMetadata, ...user } = userData;
|
||||||
setUserProfileMetadata(
|
setUserProfileMetadata(
|
||||||
isUserProfileEnabled ? user.userProfileMetadata : undefined,
|
isUserProfileEnabled ? userProfileMetadata : undefined,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (isUserProfileEnabled) {
|
if (isUserProfileEnabled) {
|
||||||
|
|
Loading…
Reference in a new issue