[v10.4.x] Fix: Do not fetch Orgs if the user is authenticated by apikey/sa or render key (#97263)

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 fa634e1476)

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
pull/97269/head
grafana-delivery-bot[bot] 1 year ago committed by GitHub
parent 40213a06b3
commit 73f75b7034
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      public/app/core/components/AppChrome/OrganizationSwitcher/OrganizationSwitcher.tsx

@ -24,7 +24,10 @@ export function OrganizationSwitcher() {
}
};
useEffect(() => {
if (contextSrv.isSignedIn) {
if (
contextSrv.isSignedIn &&
!(contextSrv.user.authenticatedBy === 'apikey' || contextSrv.user.authenticatedBy === 'render')
) {
dispatch(getUserOrganizations());
}
}, [dispatch]);

Loading…
Cancel
Save