diff --git a/app/(dashboard)/settings/SettingsClient.tsx b/app/(dashboard)/settings/SettingsClient.tsx index cbdf68fd..91b48846 100644 --- a/app/(dashboard)/settings/SettingsClient.tsx +++ b/app/(dashboard)/settings/SettingsClient.tsx @@ -2,7 +2,7 @@ import { useState } from "react"; import { useFormState } from "react-dom"; -import { Alert, Box, Button, Card, CardContent, Checkbox, Collapse, FormControl, FormControlLabel, FormLabel, MenuItem, Radio, RadioGroup, Stack, Switch, TextField, Typography } from "@mui/material"; +import { Alert, Box, Button, Card, CardContent, Checkbox, Collapse, FormControlLabel, MenuItem, Stack, Switch, TextField, Typography } from "@mui/material"; import ContentCopyIcon from "@mui/icons-material/ContentCopy"; import ExpandMoreIcon from "@mui/icons-material/ExpandMore"; import type { @@ -805,17 +805,8 @@ export default function SettingsClient({ )} } - label="Enable WAF globally" + label="Enable WAF globally (blocking)" /> - - - Engine Mode - - - } label="Off" /> - } label="On (Blocking)" /> - - } label={ diff --git a/app/(dashboard)/settings/actions.ts b/app/(dashboard)/settings/actions.ts index 15235d69..37f3c17c 100644 --- a/app/(dashboard)/settings/actions.ts +++ b/app/(dashboard)/settings/actions.ts @@ -695,9 +695,7 @@ export async function updateWafSettingsAction(_prevState: ActionResult | null, f await requireAdmin(); const enabled = formData.get("waf_enabled") === "on"; - const rawMode = formData.get("waf_mode"); - const mode: WafSettings["mode"] = - rawMode === "Off" ? "Off" : "On"; + const mode: WafSettings["mode"] = enabled ? "On" : "Off"; const loadOwasp = formData.get("waf_load_owasp_crs") === "on"; const customDirectives = typeof formData.get("waf_custom_directives") === "string" ? (formData.get("waf_custom_directives") as string).trim()