first commit
This commit is contained in:
22
frontend/app/home/page.tsx
Normal file
22
frontend/app/home/page.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
// The marketing landing page (Hero + sections) is no longer used — opening the
|
||||
// app should land directly on the dashboard. We keep the same auth check as the
|
||||
// root page: send unauthenticated visitors to login, everyone else to the dashboard.
|
||||
export default function page() {
|
||||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
const hasToken = document.cookie.includes("accessToken");
|
||||
if (!hasToken) {
|
||||
window.location.href = "/login.html";
|
||||
} else {
|
||||
router.replace("/main/overview/dashboard");
|
||||
}
|
||||
}, [router]);
|
||||
|
||||
return null;
|
||||
}
|
||||
Reference in New Issue
Block a user