Move admin area to root subdomain
CI / quality (push) Waiting to run

This commit is contained in:
MOH
2026-03-12 00:15:12 +01:00
parent e7dab6f0ef
commit 87a597c872
50 changed files with 256 additions and 140 deletions
+5 -4
View File
@@ -4,6 +4,7 @@ import { revalidatePath } from "next/cache";
import { redirect } from "next/navigation";
import { isRedirectError } from "next/dist/client/components/redirect";
import { toInternalAdminPath } from "@/lib/admin-routing";
import { clearAdminSessionCookie, isAdminAuthenticated } from "@/lib/admin-auth";
import { isCheckedFormValue } from "@/lib/form-data";
import {
@@ -15,7 +16,7 @@ import type { ContactProtectionSettings } from "@/lib/contact-protection";
function ensureAdmin() {
if (!isAdminAuthenticated()) {
clearAdminSessionCookie();
redirect("/root");
redirect("/");
}
}
@@ -85,13 +86,13 @@ export async function saveContactProtectionSettingsAction(formData: FormData) {
const nextSettings = parseContactProtectionFormData(formData, existingSettings);
await updateContactProtectionSettings(nextSettings);
revalidatePath("/root/smtp/contact-protection");
revalidatePath(toInternalAdminPath("/smtp/contact-protection"));
revalidatePath("/contact");
revalidatePath("/ar/contact");
revalidatePath("/en/contact");
redirect(
withMessage(
"/root/smtp/contact-protection",
"/smtp/contact-protection",
"success",
"Contact Protection gespeichert.",
),
@@ -106,6 +107,6 @@ export async function saveContactProtectionSettingsAction(formData: FormData) {
? error.message
: "Contact Protection konnte nicht gespeichert werden.";
redirect(withMessage("/root/smtp/contact-protection", "error", message));
redirect(withMessage("/smtp/contact-protection", "error", message));
}
}
+2 -2
View File
@@ -27,14 +27,14 @@ const copy = {
export default async function RootSMTPProtectionPage() {
if (!isAdminAuthenticated()) {
redirect("/root");
redirect("/");
}
async function logoutAction() {
"use server";
clearAdminSessionCookie();
redirect("/root");
redirect("/");
}
const settings = await getContactProtectionFormValues();