Commit Graph

4 Commits

Author SHA1 Message Date
hosseintaromi 4d385f2031 auth: update authentication system
- Update AuthContext with new login response structure
- Add isLoading state to prevent premature redirects
- Implement proper session restoration from localStorage
- Update permission checking logic (id=1 = super admin)
- Fix login form to use new API structure
- Store tokens, user info, and permissions in localStorage
2025-07-22 08:48:12 +03:30
hosseintaromi d06135824d feat(auth): implement Super Admin permission system
- Update AdminUser interface to match new API response structure
- Remove permissions/roles from AdminUser (they come separately)
- Update hasPermission logic: id=1 (AdminAll) = Super Admin access
- Fix localStorage handling to remove admin_all_permissions key
- Super Admin (permission id=1) now has access to everything
- Other users checked against their specific permissions
2025-07-22 00:01:53 +03:30
hosseintaromi 7ec69a67e7 refactor(auth): update AuthContext for new API structure
- Remove login logic from context (moved to custom hook)
- Add restoreSession functionality
- Update state management for new auth response structure
- Add permission checking by ID and title
- Manage access_token and refresh_token separately
2025-07-18 13:06:09 +03:30
hosseintaromi 46d9c20d87 Update file structure and improve code organization in the main directory 2025-07-13 22:03:22 +03:30