The login system authenticates users against a local JSON file and stores session data in localStorage. Different user roles receive different access levels and are redirected to appropriate pages.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/betovildoza/tiendaetca/llms.txt
Use this file to discover all available pages before exploring further.
Admin Credentials
The application uses a static user database located at/workspace/source/public/data/users.json.
Available Users
Authentication Flow
The authentication is handled byAuthContext (/workspace/source/src/context/AuthContext.jsx:31-71).
Step 1: Form Submission
When the login form is submitted:Step 2: User Validation
The system fetches the users.json file and validates credentials:/workspace/source/src/context/AuthContext.jsx:42-52
Step 3: Session Storage
On successful authentication:/workspace/source/src/context/AuthContext.jsx:54-57
Step 4: Role-Based Redirect
Users are redirected based on their role:- Admin Role
- Client Role
/admin/workspace/source/src/context/AuthContext.jsx:59-65
Persistent Sessions
On application load, the system checks for existing sessions:/workspace/source/src/context/AuthContext.jsx:14-28
This ensures users remain logged in across page refreshes.
Logout Functionality
Admins can logout from the admin panel:/workspace/source/src/layout/Admin.jsx:28-34
The logout only removes the
isAuth key from localStorage. Consider also removing the role key for complete session cleanup.Error Handling
The authentication system handles two types of errors:- Validation errors: Missing email or password
- Authentication errors: Invalid credentials
- Network errors: Failed to fetch users.json
/workspace/source/src/context/AuthContext.jsx:67-70