Add /admin redirect page for automatic routing
All checks were successful
Build and Push Docker Images / docker (push) Successful in 2m35s
All checks were successful
Build and Push Docker Images / docker (push) Successful in 2m35s
- Navigating to /admin redirects to /admin/dashboard if authenticated - AdminLayoutClient handles auth check and redirects to /admin/login if not authenticated - Shows loading spinner during redirect - Provides clean entry point to admin portal
This commit is contained in:
parent
4b408986e5
commit
c4059d5988
24
app/admin/page.tsx
Normal file
24
app/admin/page.tsx
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { useEffect } from 'react';
|
||||||
|
import { useRouter } from 'next/navigation';
|
||||||
|
import { Loader2 } from 'lucide-react';
|
||||||
|
|
||||||
|
export default function AdminIndex() {
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
// Redirect to dashboard
|
||||||
|
// The AdminLayoutClient will handle auth check and redirect to login if needed
|
||||||
|
router.push('/admin/dashboard');
|
||||||
|
}, [router]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="min-h-screen flex items-center justify-center bg-sail-white">
|
||||||
|
<div className="text-center">
|
||||||
|
<Loader2 className="w-8 h-8 text-deep-sea-blue animate-spin mx-auto mb-4" />
|
||||||
|
<p className="text-deep-sea-blue/70 font-medium">Redirecting to admin portal...</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user