diff --git a/app/not-found.tsx b/app/not-found.tsx new file mode 100644 index 00000000..c1d0dd64 --- /dev/null +++ b/app/not-found.tsx @@ -0,0 +1,33 @@ +"use client"; + +import { useEffect } from "react"; +import { useAuthStore } from "@/stores/auth-store"; + +export default function NotFound() { + const isAuthenticated = useAuthStore((s) => s.isAuthenticated); + + useEffect(() => { + if (!isAuthenticated) { + window.location.href = "/login"; + } + }, [isAuthenticated]); + + if (!isAuthenticated) { + return null; + } + + return ( +