completed oauth implementation on hub and dispatch
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import { ToggleTalkButton } from '../_components/ToggleTalkButton';
|
||||
import { ChangeRufgruppe } from '../_components/ChangeRufgruppe';
|
||||
import { Notifications } from '../_components/Notifications';
|
||||
import { MoonIcon, SunIcon } from '@radix-ui/react-icons';
|
||||
import Link from 'next/link';
|
||||
|
||||
export default function Navbar() {
|
||||
return (
|
||||
@@ -61,7 +61,9 @@ export default function Navbar() {
|
||||
<a>Einstellungen</a>
|
||||
</li>
|
||||
<li>
|
||||
<a>Logout</a>
|
||||
<Link href={'/logout'}>
|
||||
<p>Logout</p>
|
||||
</Link>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -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 />
|
||||
|
||||
Reference in New Issue
Block a user