Add redirect from /admin/login to /admin-login
This commit is contained in:
parent
e7944cd88f
commit
1d4acd9c2a
2 changed files with 19 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
18
src/app/admin/login/page.tsx
Normal file
18
src/app/admin/login/page.tsx
Normal 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>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue