fix admin save state architecture
This commit is contained in:
@@ -5,6 +5,7 @@ import { redirect } from "next/navigation";
|
||||
import { isRedirectError } from "next/dist/client/components/redirect";
|
||||
|
||||
import { clearAdminSessionCookie, isAdminAuthenticated } from "@/lib/admin-auth";
|
||||
import { isCheckedFormValue } from "@/lib/form-data";
|
||||
import {
|
||||
getMailSettings,
|
||||
updateMailSettings,
|
||||
@@ -53,7 +54,7 @@ function parseMailSettingsFormData(
|
||||
smtp: {
|
||||
host,
|
||||
port: parsePort(portValue || String(existingSettings.smtp.port)),
|
||||
secure: formData.get("smtpSecure") === "on",
|
||||
secure: isCheckedFormValue(formData.get("smtpSecure")),
|
||||
username,
|
||||
password: password.trim() ? password : existingSettings.smtp.password,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user