mirror of
https://github.com/yusufipk/OpenFrame.git
synced 2026-09-11 17:46:06 +00:00
18 lines
340 B
TypeScript
18 lines
340 B
TypeScript
import { redirect } from 'next/navigation';
|
|
import { auth } from '@/lib/auth';
|
|
|
|
export default async function AuthLayout({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode;
|
|
}) {
|
|
const session = await auth();
|
|
|
|
// If already logged in, redirect to dashboard
|
|
if (session?.user) {
|
|
redirect('/dashboard');
|
|
}
|
|
|
|
return <>{children}</>;
|
|
}
|