refactor: move auth check into pages
This commit is contained in:
parent
dd6b82515e
commit
ddcb14e564
3 changed files with 13 additions and 18 deletions
|
@ -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');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue