export const dynamic = 'force-dynamic'

import { redirect } from 'next/navigation'
import { getCurrentUser } from '@/lib/auth'
import { initDatabase } from '@/lib/db-schema'

export default async function Home() {
  initDatabase()
  const user = await getCurrentUser()
  if (user) redirect('/dashboard')
  else redirect('/login')
}
