// app/layout.tsx (server) import './globals.css'; import { Providers } from './providers'; import type { ReactNode } from 'react'; import { getServerSession } from 'next-auth'; import { authOptions } from '@/lib/auth-options'; import { Toaster } from "@/components/ui/sonner" export const metadata = { title: 'OW ANIMATION ARTS VAULT', description: '...', }; export default async function RootLayout({ children }: { children: ReactNode }) { // get server session and pass into client SessionProvider for identical initial markup const session = await getServerSession(authOptions); return (
{/* pass session to Providers to avoid client/server mismatch */}