From 1de9f9477f19041a2495b2738f0dae965bf1da55 Mon Sep 17 00:00:00 2001 From: "grafana-delivery-bot[bot]" <132647405+grafana-delivery-bot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 16:06:48 +0100 Subject: [PATCH] [v11.3.x] Fix: Do not fetch Orgs if the user is authenticated by apikey/sa or render key (#97262) Fix: Do not fetch Orgs if the user is authenticated by apikey/sa or render key (#97162) * Do not fetch Orgs if the user is authenticated by apikey/sa or render svc * Lint (cherry picked from commit fa634e14765f397e959bbb8f2792176e97ba352b) Co-authored-by: Misi --- .../AppChrome/OrganizationSwitcher/OrganizationSwitcher.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/app/core/components/AppChrome/OrganizationSwitcher/OrganizationSwitcher.tsx b/public/app/core/components/AppChrome/OrganizationSwitcher/OrganizationSwitcher.tsx index 1fbcd63ca39..a872775d644 100644 --- a/public/app/core/components/AppChrome/OrganizationSwitcher/OrganizationSwitcher.tsx +++ b/public/app/core/components/AppChrome/OrganizationSwitcher/OrganizationSwitcher.tsx @@ -28,7 +28,10 @@ export function OrganizationSwitcher() { } }; useEffect(() => { - if (contextSrv.isSignedIn) { + if ( + contextSrv.isSignedIn && + !(contextSrv.user.authenticatedBy === 'apikey' || contextSrv.user.authenticatedBy === 'render') + ) { dispatch(getUserOrganizations()); } }, [dispatch]);