From 93a14b190e8be8cb6f86be005cf5f75ee562e9f0 Mon Sep 17 00:00:00 2001 From: sean-brydon <55134778+sean-brydon@users.noreply.github.com> Date: Fri, 25 Nov 2022 12:36:33 +0000 Subject: [PATCH] Fix Impersonation Refresh Bug (#5679) Co-authored-by: Peer Richelsen --- .../pages/settings/admin/impersonation.tsx | 4 +-- .../components/ImpersonatingBanner.tsx | 29 ++++++++----------- packages/ui/v2/core/layouts/AdminLayout.tsx | 2 +- 3 files changed, 14 insertions(+), 21 deletions(-) diff --git a/apps/web/pages/settings/admin/impersonation.tsx b/apps/web/pages/settings/admin/impersonation.tsx index 8ab2f39a73..993d37ba53 100644 --- a/apps/web/pages/settings/admin/impersonation.tsx +++ b/apps/web/pages/settings/admin/impersonation.tsx @@ -16,9 +16,7 @@ function AdminView() { onSubmit={(e) => { e.preventDefault(); const enteredUsername = usernameRef.current?.value.toLowerCase(); - signIn("impersonation-auth", { username: enteredUsername }).then((res) => { - console.log(res); - }); + signIn("impersonation-auth", { username: enteredUsername }); }}>
- {t("impersonating_user_warning", { user: data.user.username })}{" "} - - - Click Here To stop - - . - - - } - className="mx-4 mb-2 sm:mx-6 md:mx-8" - /> + <> + + Click Here To stop + + } + /> + ); } diff --git a/packages/ui/v2/core/layouts/AdminLayout.tsx b/packages/ui/v2/core/layouts/AdminLayout.tsx index 0f2ff14321..1dcd4b9208 100644 --- a/packages/ui/v2/core/layouts/AdminLayout.tsx +++ b/packages/ui/v2/core/layouts/AdminLayout.tsx @@ -17,7 +17,7 @@ export default function AdminLayout({ // Force redirect on component level useEffect(() => { if (session.data && session.data.user.role !== UserPermissionRole.ADMIN) { - router.replace("/settings"); + router.replace("/settings/my-account/profile"); } }, [session, router]);