🔧 Update Admin Dashboard and Authentication Flow
✅ Updated Admin Dashboard URL: - Changed the Admin Dashboard access path from `/admin` to `/manage` in multiple files for consistency. ✅ Enhanced Middleware Authentication: - Updated middleware to protect new admin routes including `/manage` and `/dashboard`. ✅ Implemented CSRF Protection: - Added CSRF token generation and validation for login and session validation routes. ✅ Introduced Rate Limiting: - Added rate limiting for admin routes and CSRF token requests to enhance security. ✅ Refactored Admin Page: - Created a new admin management page with improved authentication handling and user feedback. 🎯 Overall Improvements: - Strengthened security measures for admin access. - Improved user experience with clearer navigation and feedback. - Streamlined authentication processes for better performance.
This commit is contained in:
@@ -67,15 +67,22 @@ interface PerformanceData {
|
||||
topInteractions: Record<string, number>;
|
||||
}
|
||||
|
||||
export function AnalyticsDashboard() {
|
||||
interface AnalyticsDashboardProps {
|
||||
isAuthenticated?: boolean;
|
||||
}
|
||||
|
||||
export function AnalyticsDashboard({ isAuthenticated = true }: AnalyticsDashboardProps) {
|
||||
const [analyticsData, setAnalyticsData] = useState<AnalyticsData | null>(null);
|
||||
const [performanceData, setPerformanceData] = useState<PerformanceData | null>(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
fetchAnalyticsData();
|
||||
}, []);
|
||||
// Only fetch data if authenticated
|
||||
if (isAuthenticated) {
|
||||
fetchAnalyticsData();
|
||||
}
|
||||
}, [isAuthenticated]);
|
||||
|
||||
const fetchAnalyticsData = async () => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user