Overview
Sistema Venta uses a secure email and password authentication system to protect your business data. The authentication system validates user credentials against the backend API and maintains user sessions throughout your workflow.Logging In
Access the Login Page
Navigate to the Sistema Venta login page. You’ll see a clean login form with email and password fields.
Enter Your Credentials
- Enter your registered email address in the Email field
- Enter your password in the Contraseña (Password) field
- Toggle password visibility using the eye icon to verify your entry
Login Interface
The login page (login.component.html) features:
- Email Field: Material Design input with mail icon
- Password Field: Secure input with visibility toggle
- Login Button: Disabled until both fields are filled (form validation)
- Loading Indicator: Progress bar appears during authentication
The login form uses Angular reactive forms with built-in validation. The login button remains disabled until both email and password are provided.
Authentication Flow
The authentication process works as follows:- User Input: Form captures email and password (
login.component.ts:40-43) - API Call:
UsuarioService.iniciarSesion()sends credentials to/Usuario/IniciarSesionendpoint - Session Creation: On success, user data is stored in session via
UtilidadService.guardarSesionUsuario() - Navigation: User is redirected to
/pages(main application)
Error Handling
Sistema Venta provides clear feedback for authentication issues:Invalid Credentials
Message: “No se encontraron coincidencias” (No matches found)This appears when email/password combination doesn’t exist in the database.
Connection Error
Message: “Hubo un error” (There was an error)This appears when the API server is unreachable or returns an error.
Session Management
Once authenticated, your session data includes:- User ID and full name
- Email address
- Role ID and role description
- Active status
- Which menu items you can access
- What actions you can perform
- Your permissions throughout the system
Session data is managed by
UtilidadService and persists as long as you remain logged in. The system uses this data for authorization checks throughout the application.Security Features
Sistema Venta implements several security measures:- Password Masking: Passwords are hidden by default with optional visibility toggle
- Form Validation: Client-side validation prevents empty submissions
- Secure Transport: All authentication requests use HTTP POST
- Session Storage: User credentials are stored securely after authentication
Related Components
- Component:
login.component.ts- Handles login logic and form management - Service:
usuario.service.ts:19-21- Manages authentication API calls - Utility:
utilidad.service.ts- Handles session storage and alerts
Troubleshooting
Login button is disabled
Login button is disabled
Can't see password characters
Can't see password characters
Click the eye icon on the right side of the password field to toggle between hidden and visible password display.
Login keeps failing with valid credentials
Login keeps failing with valid credentials
Check that:
- Your account status is active (esActivo = 1)
- You’re using the correct email format
- The API server is running and accessible
- There are no network connectivity issues