"use client" import { OrgSettingsSection } from "@/components/admin/settings/org-settings-form" import { useOrgSettingsStore } from "@/lib/admin-settings/org-settings-store" import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" import { Switch } from "@/components/ui/switch" import { Checkbox } from "@/components/ui/checkbox" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" const METHODS = [ { id: "totp" as const, label: "Application TOTP" }, { id: "webauthn" as const, label: "Clés de sécurité (WebAuthn)" }, { id: "sms" as const, label: "SMS" }, ] export function SecuritySection() { const twoFactor = useOrgSettingsStore((s) => s.twoFactor) const setTwoFactor = useOrgSettingsStore((s) => s.setTwoFactor) function toggleMethod(id: (typeof METHODS)[number]["id"], checked: boolean) { const methods = checked ? [...new Set([...twoFactor.allowed_methods, id])] : twoFactor.allowed_methods.filter((m) => m !== id) setTwoFactor({ allowed_methods: methods }) } return ( Exigences Méthodes autorisées {METHODS.map((method) => ( ))}
setTwoFactor({ grace_period_days: Number(e.target.value) || 0 }) } />
setTwoFactor({ remember_device_days: Number(e.target.value) || 0 }) } />
) }