This commit is contained in:
@@ -7,7 +7,7 @@ import { routing } from "@/i18n/routing";
|
||||
import { getAdminAppPath, toInternalAdminPath } from "@/lib/admin-routing";
|
||||
import { clearAdminSessionCookie, isAdminAuthenticated } from "@/lib/admin-auth";
|
||||
import { getLocalizedPath } from "@/lib/locale";
|
||||
import { setMaintenanceMode } from "@/lib/app-config";
|
||||
import { getSiteSettings, setMaintenanceMode } from "@/lib/app-config";
|
||||
|
||||
async function ensureAdmin() {
|
||||
if (!(await isAdminAuthenticated())) {
|
||||
@@ -33,10 +33,11 @@ export async function updateMaintenanceModeAction(formData: FormData) {
|
||||
revalidatePath(toInternalAdminPath("/"));
|
||||
revalidatePath(toInternalAdminPath("/maintenance"));
|
||||
revalidatePath(toInternalAdminPath(redirectUrl.pathname));
|
||||
const siteSettings = await getSiteSettings();
|
||||
|
||||
for (const appLocale of routing.locales) {
|
||||
revalidatePath(getLocalizedPath(appLocale), "layout");
|
||||
revalidatePath(getLocalizedPath(appLocale, "/coming-soon"));
|
||||
revalidatePath(getLocalizedPath(appLocale, "/", siteSettings.defaultLocale), "layout");
|
||||
revalidatePath(getLocalizedPath(appLocale, "/coming-soon", siteSettings.defaultLocale));
|
||||
}
|
||||
|
||||
redirect(`${redirectUrl.pathname}${redirectUrl.search}`);
|
||||
|
||||
Reference in New Issue
Block a user