Overview
CEMAC provides secure authentication for both administrators and employees. Each role has different access levels and capabilities within the system.User Roles
CEMAC supports two types of users:- Administrators: Full access to all system features including user management, inventory, sales, and analytics
- Employees: Access to sales processing and basic inventory viewing
Administrator Login
Navigate to the login page
Open your browser and go to the CEMAC application URL. You’ll see the administrator login page by default.
Enter your credentials
- Usuario: Enter your administrator username
- Contraseña: Enter your password
authService.js service.The authentication service automatically detects whether you’re in development or production mode and adjusts the API endpoint accordingly.
Employee Login
Access the employee login page
From the administrator login page, click “Iniciar como Empleado” at the bottom of the form.
Enter employee credentials
- Correo: Enter your employee email address
- Contraseña: Enter your employee password
Password Recovery
For Administrators
Request reset
The system calls
authService.requestPasswordReset(email, true) to send a password reset link to your email.For Employees
Request reset
The system calls
authService.requestPasswordReset(email, false) for employee accounts.Session Management
Authentication Token
CEMAC uses bearer token authentication:Session Verification
The system automatically verifies your session when:- Loading protected pages
- Making API requests
- Refreshing the browser
Logout
Security Best Practices
- Never share credentials: Each user should have their own account
- Use strong passwords: Combine letters, numbers, and special characters
- Log out properly: Always use the logout button instead of just closing the browser
- Report suspicious activity: Contact your administrator if you notice unauthorized access
Troubleshooting
Login Failed
If you receive an authentication error:- Verify your username/email and password are correct
- Check that Caps Lock is not enabled
- Clear your browser cache and try again
- Contact your system administrator if the issue persists
Session Expired
If you see “Sesión expirada o inválida”:- This is normal after extended inactivity
- Simply log in again with your credentials
- Your work will be preserved on the server
Cannot Access Password Reset
If password reset emails aren’t arriving:- Check your spam/junk folder
- Verify the email address is correct
- Wait a few minutes for delivery
- Contact your administrator for manual password reset
Technical Reference
The authentication system is powered by:- Service:
authService.js- Handles all authentication operations - API Base URL:
https://cemac-api.vercel.app - Endpoints:
POST /auth/login- User loginPOST /auth/logout- User logoutGET /auth/verify- Token verificationPOST /auth/recover- Password recovery
Development mode automatically uses a local proxy server instead of the production API.