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
+5 -9
View File
@@ -12,6 +12,7 @@ import { Button } from "@/components/ui/button";
import { api, OrgPolicyResponse, UpdateOrgPolicyDto, create403Handler } from "@/lib/api";
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
import { useToast } from "@/hooks/use-toast";
import { useOrganizations } from "@/hooks/useOrganizations";
const MFA_MODE_LABELS: Record<string, { label: string; description: string }> = {
disabled: {
@@ -51,18 +52,13 @@ export default function PoliciesPage() {
const [hasUnsavedChanges, setHasUnsavedChanges] = useState(false);
// Fetch organizations to get current org
const { data: orgsData, isLoading: orgsLoading } = useQuery({
queryKey: ['organizations'],
queryFn: () => api.users.organizations({
on403: create403Handler(toast),
}),
});
const { data: organizations, isLoading: orgsLoading } = useOrganizations();
useEffect(() => {
if (orgsData?.organizations && orgsData.organizations.length > 0) {
setCurrentOrgId(orgsData.organizations[0].id);
if (organizations && organizations.length > 0) {
setCurrentOrgId(organizations[0].id);
}
}, [orgsData]);
}, [organizations]);
// Fetch org policy
const { data: policy, isLoading: policyLoading } = useQuery({