Add admin login activity logging

- Add AdminLoginLog model to track all login attempts
- Record successful and failed login attempts
- Capture IP address and user agent for each login
- Create /admin/login-logs page to view activity history
- Show login stats (successes, failures, last 30 days)
- Display browser/device and IP for each login
- Add "Login activity" link to admin menu
- Useful for security auditing and monitoring access

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
Andymick
2026-07-16 21:33:40 +01:00
co-authored by Claude Haiku 4.5
parent 53dd963090
commit ea6f9d2e25
4 changed files with 153 additions and 0 deletions
+1
View File
@@ -22,6 +22,7 @@ const ADMIN_LINKS = [
{ href: '/admin/collections', label: 'All collections' },
{ href: '/admin/customers', label: 'Email customers' },
{ href: '/admin/maintenance', label: 'Maintenance' },
{ href: '/admin/login-logs', label: 'Login activity' },
];
export default function AdminMenu() {