--- id: 1-2 title: 1-2 Authentication & Role System status: Done date: 2026-09-27 parent: 1 --- ## Description As an admin, I want a secure authentication system with Admin/Client roles, So that only authorized users can access the platform with appropriate permissions. Full implementation history: docs/stories/story-1.2-authentication-role-system.md ## Acceptance Criteria - [ ] Fortify configured with custom Volt views - [ ] Login page with bilingual support (Arabic/English) - [ ] Session timeout after 2 hours of inactivity - [ ] Rate limiting on login attempts (5 attempts per minute) - [ ] Admin role with full access to all features - [ ] Client role with restricted access (own data only) - [ ] Registration feature DISABLED (admin creates all accounts) - [ ] CSRF protection enabled on all forms - [ ] Password hashing using bcrypt - [ ] Custom middleware for admin authorization - [ ] Secure session configuration - [ ] Remember me functionality (optional) - [ ] Login redirects to appropriate dashboard: - [ ] Logout clears session properly and redirects to login page - [ ] Admin middleware protects admin-only routes (return 403 for unauthorized) - [ ] Failed login attempts logged to `admin_logs` table - [ ] Deactivated users cannot log in - [ ] Login form validates inputs properly - [ ] Error messages are clear and bilingual - [ ] All test scenarios in "Testing" section pass - [ ] No security vulnerabilities