completed oauth implementation on hub and dispatch

This commit is contained in:
PxlLoewe
2025-02-03 00:45:55 +01:00
parent 93804855f1
commit 71b401f8ab
18 changed files with 327 additions and 16 deletions

View File

@@ -1,16 +1,23 @@
import type { Metadata } from 'next';
import Navbar from './_components/Navbar';
import { useSession } from 'next-auth/react';
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 function RootLayout({
export default async function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
const session = await getServerSession();
if (!session) {
redirect('/login');
}
return (
<>
<Navbar />