From fa634e14765f397e959bbb8f2792176e97ba352b Mon Sep 17 00:00:00 2001 From: Misi Date: Thu, 28 Nov 2024 17:44:11 +0100 Subject: [PATCH] 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 --- .../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]);