forked from baron/baron-sso
fix(adminfront): allow tenant admin to view list when managing multiple tenants and fix dev profile fetching
This commit is contained in:
@@ -43,7 +43,9 @@ function AppLayout() {
|
|||||||
const { data: profile } = useQuery({
|
const { data: profile } = useQuery({
|
||||||
queryKey: ["me"],
|
queryKey: ["me"],
|
||||||
queryFn: fetchMe,
|
queryFn: fetchMe,
|
||||||
enabled: auth.isAuthenticated && !auth.isLoading,
|
enabled:
|
||||||
|
(auth.isAuthenticated && !auth.isLoading) ||
|
||||||
|
import.meta.env.MODE === "development",
|
||||||
});
|
});
|
||||||
|
|
||||||
const navItems = React.useMemo(() => {
|
const navItems = React.useMemo(() => {
|
||||||
|
|||||||
@@ -69,8 +69,8 @@ function TenantListPage() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// While redirecting
|
// While redirecting (only if exactly one manageable tenant)
|
||||||
if (profile?.role === "tenant_admin") {
|
if (profile?.role === "tenant_admin" && (profile.manageableTenants?.length ?? 0) <= 1) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user