From 3fb8c5bbc5b7cb00cf00f370ec7abc4d07fa6f92 Mon Sep 17 00:00:00 2001 From: Dhairyashil Shinde <93669429+dhairyashiil@users.noreply.github.com> Date: Thu, 23 Oct 2025 06:42:20 +0530 Subject: [PATCH] fix: impersonate correct user using email (#24648) --- packages/features/ee/users/components/UsersTable.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/features/ee/users/components/UsersTable.tsx b/packages/features/ee/users/components/UsersTable.tsx index da2dc2917b..c62d355124 100644 --- a/packages/features/ee/users/components/UsersTable.tsx +++ b/packages/features/ee/users/components/UsersTable.tsx @@ -135,8 +135,8 @@ function UsersTableBare() { }, }); - const handleImpersonateUser = async (username: string | null) => { - await signIn("impersonation-auth", { username: username, callbackUrl: `${WEBAPP_URL}/event-types` }); + const handleImpersonateUser = async (email: string | null) => { + await signIn("impersonation-auth", { username: email, callbackUrl: `${WEBAPP_URL}/event-types` }); }; //we must flatten the array of arrays from the useInfiniteQuery hook @@ -243,7 +243,7 @@ function UsersTableBare() { { id: "impersonate-user", label: "Impersonate User", - onClick: () => handleImpersonateUser(user?.username), + onClick: () => handleImpersonateUser(user?.email), icon: "user", }, { @@ -275,7 +275,7 @@ function UsersTableBare() { id: "impersonation", label: "Impersonate", onClick: () => { - setSelectedUser(user.username); + setSelectedUser(user.email); setShowImpersonateModal(true); }, icon: "venetian-mask", @@ -345,7 +345,7 @@ const DeleteUserDialog = ({ onClose: () => void; }) => { return ( - // eslint-disable-next-line @typescript-eslint/no-empty-function -- noop + (open ? () => {} : onClose())}>