@@ -11,23 +11,24 @@ import { getLocalizedPath, resolveLocale } from "@/lib/locale";
|
||||
|
||||
type SiteLayoutProps = {
|
||||
children: ReactNode;
|
||||
params: {
|
||||
params: Promise<{
|
||||
locale: string;
|
||||
};
|
||||
}>;
|
||||
};
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
export const revalidate = 0;
|
||||
|
||||
export default async function SiteLayout({ children, params: { locale } }: SiteLayoutProps) {
|
||||
export default async function SiteLayout({ children, params }: SiteLayoutProps) {
|
||||
noStore();
|
||||
const { locale } = await params;
|
||||
|
||||
const localeKey = resolveLocale(locale);
|
||||
const [maintenanceEnabled, mediaBindings] = await Promise.all([
|
||||
getMaintenanceMode(),
|
||||
getSiteSettingsMediaBindings(),
|
||||
]);
|
||||
const authenticated = isAdminAuthenticated();
|
||||
const authenticated = await isAdminAuthenticated();
|
||||
|
||||
if (maintenanceEnabled && !authenticated) {
|
||||
redirect(getLocalizedPath(localeKey, "/coming-soon"));
|
||||
|
||||
Reference in New Issue
Block a user