Files
var-monorepo/apps/dispatch/app/(dispatch)/layout.tsx
2025-03-15 11:09:55 -07:00

27 lines
546 B
TypeScript

import type { Metadata } from "next";
import Navbar from "./_components/Navbar";
import { redirect } from "next/navigation";
import { getServerSession } from "../api/auth/[...nextauth]/auth";
export const metadata: Metadata = {
title: "VAR Leitstelle v2",
description: "Die neue VAR Leitstelle.",
};
export default async function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
const session = await getServerSession();
if (!session) {
redirect("/login");
}
return (
<>
<Navbar />
{children}
</>
);
}