Files
edueasy/app/parent/page.tsx
T

22 lines
493 B
TypeScript

"use client"
import { useEffect } from "react"
import { useRouter } from "next/navigation"
import { authClient } from "@/lib/auth-client"
export default function ParentPage() {
const { data: session, isPending } = authClient.useSession()
const router = useRouter()
useEffect(() => {
if (isPending) return
if (session) {
router.replace("/parent/dashboard")
} else {
router.replace("/parent/auth/login")
}
}, [session, isPending, router])
return null
}