refactor: move auth check into pages

This commit is contained in:
Dominik 2025-05-12 21:17:46 +02:00 committed by Dominik
parent dd6b82515e
commit ddcb14e564
3 changed files with 13 additions and 18 deletions

View file

@ -1,3 +1,9 @@
export default function Home() {
return <div></div>;
import { auth } from '@/auth';
import { redirect } from 'next/navigation';
export default async function Home() {
const session = await auth();
if (!session?.user) redirect('/login');
else redirect('/home');
}