This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import type { ReactNode } from "react";
|
||||
import { unstable_noStore as noStore } from "next/cache";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import { Footer } from "@/components/footer";
|
||||
import { Navbar } from "@/components/navbar";
|
||||
import { isAdminAuthenticated } from "@/lib/admin-auth";
|
||||
import { getMaintenanceMode } from "@/lib/app-config";
|
||||
import { resolveLocale } from "@/lib/site-data";
|
||||
|
||||
@@ -13,11 +15,17 @@ type SiteLayoutProps = {
|
||||
};
|
||||
};
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
export const revalidate = 0;
|
||||
|
||||
export default async function SiteLayout({ children, params: { locale } }: SiteLayoutProps) {
|
||||
noStore();
|
||||
|
||||
const localeKey = resolveLocale(locale);
|
||||
const maintenanceEnabled = await getMaintenanceMode();
|
||||
const authenticated = isAdminAuthenticated();
|
||||
|
||||
if (maintenanceEnabled) {
|
||||
if (maintenanceEnabled && !authenticated) {
|
||||
redirect(`/${localeKey}/coming-soon`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user