fix(auth): useAuth() hook in AppShell/StartLayout + is_system_admin in login response
This commit is contained in:
@@ -82,6 +82,7 @@ async def login(
|
|||||||
"tenant_id": str(tenant.id),
|
"tenant_id": str(tenant.id),
|
||||||
"tenant_name": tenant.name,
|
"tenant_name": tenant.name,
|
||||||
"csrf_token": csrf_token,
|
"csrf_token": csrf_token,
|
||||||
|
"is_system_admin": user.is_system_admin,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
resp.set_cookie(
|
resp.set_cookie(
|
||||||
|
|||||||
@@ -15,9 +15,11 @@ import { WelcomeDialog } from '@/components/onboarding/WelcomeDialog';
|
|||||||
import { OnboardingTour } from '@/components/onboarding/OnboardingTour';
|
import { OnboardingTour } from '@/components/onboarding/OnboardingTour';
|
||||||
import { CommandPalette } from '@/components/search/CommandPalette';
|
import { CommandPalette } from '@/components/search/CommandPalette';
|
||||||
import { useOnboardingStore } from '@/store/onboardingStore';
|
import { useOnboardingStore } from '@/store/onboardingStore';
|
||||||
|
import { useAuth } from '@/hooks/useAuth';
|
||||||
|
|
||||||
export function AppShell() {
|
export function AppShell() {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
useAuth();
|
||||||
|
|
||||||
// Track context for AI Proactive suggestions
|
// Track context for AI Proactive suggestions
|
||||||
useAIContext();
|
useAIContext();
|
||||||
|
|||||||
@@ -10,8 +10,10 @@ import { PluginRegistry } from '@/components/plugins/PluginRegistry';
|
|||||||
import { ErrorBoundary } from '@/components/common/ErrorBoundary';
|
import { ErrorBoundary } from '@/components/common/ErrorBoundary';
|
||||||
import { Outlet } from 'react-router-dom';
|
import { Outlet } from 'react-router-dom';
|
||||||
import { CommandPalette } from '@/components/search/CommandPalette';
|
import { CommandPalette } from '@/components/search/CommandPalette';
|
||||||
|
import { useAuth } from '@/hooks/useAuth';
|
||||||
|
|
||||||
export function StartLayout() {
|
export function StartLayout() {
|
||||||
|
useAuth();
|
||||||
return (
|
return (
|
||||||
<div className="flex h-screen overflow-hidden bg-secondary-50" data-testid="start-layout">
|
<div className="flex h-screen overflow-hidden bg-secondary-50" data-testid="start-layout">
|
||||||
<PluginRegistry />
|
<PluginRegistry />
|
||||||
|
|||||||
Reference in New Issue
Block a user