mirror of
https://github.com/yusufipk/OpenFrame.git
synced 2026-09-11 09:36:08 +00:00
14 lines
334 B
TypeScript
14 lines
334 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}</>;
|
|
}
|