18 lines
474 B
TypeScript
18 lines
474 B
TypeScript
import { checkSession } from "@/actions/auth/session";
|
|
import { redirect } from "next/navigation";
|
|
|
|
export default async function Layout({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode;
|
|
}) {
|
|
const sessionResult = await checkSession();
|
|
|
|
// If there's an active session, redirect to dashboard
|
|
if (sessionResult.success && sessionResult.redirectTo) {
|
|
redirect(sessionResult.redirectTo);
|
|
}
|
|
|
|
return <div className="max-w-full gap-12 items-start">{children}</div>;
|
|
}
|