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
This commit is contained in:
Misi
2024-11-28 17:44:11 +01:00
committed by GitHub
parent cc0ec349a4
commit fa634e1476
@@ -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]);