Upgrade app to Next.js 16
CI / quality (push) Waiting to run

This commit is contained in:
MOH
2026-03-13 15:50:37 +01:00
parent f14116b56c
commit e32ac4cacb
40 changed files with 1853 additions and 1157 deletions
+6 -6
View File
@@ -2,7 +2,7 @@
import { revalidatePath } from "next/cache";
import { redirect } from "next/navigation";
import { isRedirectError } from "next/dist/client/components/redirect";
import { isRedirectError } from "next/dist/client/components/redirect-error";
import { toInternalAdminPath } from "@/lib/admin-routing";
import { clearAdminSessionCookie, isAdminAuthenticated } from "@/lib/admin-auth";
@@ -14,9 +14,9 @@ import {
import { sendTestEmail } from "@/lib/mail";
import type { MailSettings } from "@/lib/mail-settings";
function ensureAdmin() {
if (!isAdminAuthenticated()) {
clearAdminSessionCookie();
async function ensureAdmin() {
if (!(await isAdminAuthenticated())) {
await clearAdminSessionCookie();
redirect("/");
}
}
@@ -71,7 +71,7 @@ function parseMailSettingsFormData(
}
export async function saveMailSettingsAction(formData: FormData) {
ensureAdmin();
await ensureAdmin();
try {
const existingMailSettings = await getMailSettings();
@@ -95,7 +95,7 @@ export async function saveMailSettingsAction(formData: FormData) {
}
export async function sendTestEmailAction() {
ensureAdmin();
await ensureAdmin();
try {
await sendTestEmail();
+5 -5
View File
@@ -2,7 +2,7 @@
import { revalidatePath } from "next/cache";
import { redirect } from "next/navigation";
import { isRedirectError } from "next/dist/client/components/redirect";
import { isRedirectError } from "next/dist/client/components/redirect-error";
import { toInternalAdminPath } from "@/lib/admin-routing";
import { clearAdminSessionCookie, isAdminAuthenticated } from "@/lib/admin-auth";
@@ -13,9 +13,9 @@ import {
} from "@/lib/app-config";
import type { ContactProtectionSettings } from "@/lib/contact-protection";
function ensureAdmin() {
if (!isAdminAuthenticated()) {
clearAdminSessionCookie();
async function ensureAdmin() {
if (!(await isAdminAuthenticated())) {
await clearAdminSessionCookie();
redirect("/");
}
}
@@ -79,7 +79,7 @@ function parseContactProtectionFormData(
}
export async function saveContactProtectionSettingsAction(formData: FormData) {
ensureAdmin();
await ensureAdmin();
try {
const existingSettings = await getContactProtectionSettings();
+2 -2
View File
@@ -26,14 +26,14 @@ const copy = {
};
export default async function RootSMTPProtectionPage() {
if (!isAdminAuthenticated()) {
if (!(await isAdminAuthenticated())) {
redirect("/");
}
async function logoutAction() {
"use server";
clearAdminSessionCookie();
await clearAdminSessionCookie();
redirect("/");
}
+2 -2
View File
@@ -27,14 +27,14 @@ const copy = {
};
export default async function RootSMTPPage() {
if (!isAdminAuthenticated()) {
if (!(await isAdminAuthenticated())) {
redirect("/");
}
async function logoutAction() {
"use server";
clearAdminSessionCookie();
await clearAdminSessionCookie();
redirect("/");
}