Fix jwt-token

This commit is contained in:
2025-09-14 09:45:03 +02:00
parent 81ed8a13eb
commit cfa1af0fd0
2 changed files with 21 additions and 0 deletions

View File

@@ -36,6 +36,13 @@ const Layout = () => {
// Build navigation based on user permissions
const navigation = React.useMemo(() => {
console.log('🔍 Layout navigation recalculating:', {
userExists: !!user,
userRole: user?.role,
canAccessSettings: user?.role ? canAccessSettings(user.role) : false,
hasDebugPermission: user?.role ? hasPermission(user.role, 'debug.access') : false
});
if (!user?.role) {
return baseNavigation; // Return base navigation if user not loaded yet
}
@@ -52,6 +59,7 @@ const Layout = () => {
nav.push({ name: 'Debug', href: '/debug', icon: BugAntIcon });
}
console.log('✅ Navigation built:', nav.map(n => n.name));
return nav;
}, [user]);