use users realm to edit admin user

fixes: #32915

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
(cherry picked from commit 5e65bdde1618804274c9da2f33a68ed4014fd1a7)
This commit is contained in:
Erik Jan de Wit 2024-10-04 14:11:02 +02:00 committed by GitHub
parent 170c9d604b
commit e15e4c679d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 4 deletions

View File

@ -22,7 +22,6 @@ import {
import { useAdminClient } from "../admin-client";
import { useAlerts } from "../components/alert/Alerts";
import { FormAccess } from "../components/form/FormAccess";
import { useRealm } from "../context/realm-context/RealmContext";
import { toUser } from "../user/routes/User";
import { emailRegexPattern } from "../util";
import { useCurrentUser } from "../utils/useCurrentUser";
@ -44,7 +43,6 @@ export const RealmSettingsEmailTab = ({
const { adminClient } = useAdminClient();
const { t } = useTranslation();
const { realm: realmName } = useRealm();
const { addAlert, addError } = useAlerts();
const currentUser = useCurrentUser();
@ -254,7 +252,7 @@ export const RealmSettingsEmailTab = ({
<Link
{...props}
to={toUser({
realm: realmName,
realm: currentUser.realm!,
id: currentUser.id!,
tab: "settings",
})}

View File

@ -15,5 +15,5 @@ export function useCurrentUser() {
userId,
]);
return currentUser;
return { ...currentUser, realm: whoAmI.getRealm() };
}