From 1d4acd9c2a4d9a9b9c1a2fac29911dfa6262a906 Mon Sep 17 00:00:00 2001 From: Mannu Date: Sun, 10 May 2026 23:28:43 +0530 Subject: [PATCH] Add redirect from /admin/login to /admin-login --- src/app/admin/layout.tsx | 2 +- src/app/admin/login/page.tsx | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 src/app/admin/login/page.tsx diff --git a/src/app/admin/layout.tsx b/src/app/admin/layout.tsx index e41f1c9..eaedfae 100644 --- a/src/app/admin/layout.tsx +++ b/src/app/admin/layout.tsx @@ -28,7 +28,7 @@ export default function AdminLayout({ children }: { children: React.ReactNode }) const [admin, setAdmin] = useState<{ username: string; role: string } | null>(null); // Check if this is the login page - don't show sidebar - const isLoginPage = pathname === "/admin/login" || pathname === "/admin-login"; + const isLoginPage = pathname === "/admin-login"; useEffect(() => { // Only check auth if not on login page diff --git a/src/app/admin/login/page.tsx b/src/app/admin/login/page.tsx new file mode 100644 index 0000000..77ecc47 --- /dev/null +++ b/src/app/admin/login/page.tsx @@ -0,0 +1,18 @@ +"use client"; + +import { useEffect } from "react"; +import { useRouter } from "next/navigation"; + +export default function AdminLoginRedirect() { + const router = useRouter(); + + useEffect(() => { + router.replace("/admin-login"); + }, [router]); + + return ( +
+
Redirecting...
+
+ ); +} \ No newline at end of file