Feat(Fix): SSH Keys-Expiry+Log; Department+Principal Link; CA Keys mgmt;

- Fix Login nav to /profile or /
This commit is contained in:
2026-02-28 23:35:32 +05:45
parent c32cb4757a
commit 62f767474b
12 changed files with 2850 additions and 236 deletions
+3 -7
View File
@@ -19,16 +19,12 @@ import { ComplianceBanner } from "@/components/auth/ComplianceBanner";
export function TopBar() {
const navigate = useNavigate();
const { user, isAuthenticated, mfaCompliance } = useAuth();
const { user, isAuthenticated, mfaCompliance, logout } = useAuth();
const [currentOrg, setCurrentOrg] = useState<Organization | null>(null);
// Use React Query hook for organizations with automatic caching and deduplication
const { data: organizations = [], isLoading: orgsLoading } = useOrganizations();
// Debug logging
console.log('[TopBar] organizations data:', organizations);
console.log('[TopBar] organizations is array:', Array.isArray(organizations));
// Ensure organizations is always an array (defensive check)
const organizationsArray = Array.isArray(organizations) ? organizations : [];
@@ -39,8 +35,8 @@ export function TopBar() {
}
}, [organizationsArray, currentOrg]);
const handleLogout = () => {
navigate("/login");
const handleLogout = async () => {
await logout();
};
const userInitials = user?.full_name