Add redirect from /admin/login to /admin-login

This commit is contained in:
Manohar Gupta 2026-05-10 23:28:43 +05:30
parent e7944cd88f
commit 1d4acd9c2a
2 changed files with 19 additions and 1 deletions

View file

@ -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

View file

@ -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 (
<div className="min-h-screen flex items-center justify-center bg-gray-900">
<div className="text-white">Redirecting...</div>
</div>
);
}