ICP System authenticates users with JSON Web Tokens (JWT). You POST your credentials to the login endpoint, receive anDocumentation Index
Fetch the complete documentation index at: https://isp.misidev.space/llms.txt
Use this file to discover all available pages before exploring further.
access_token, and that token is automatically attached to every subsequent API request as a Bearer header.
Login flow
To log in, send aPOST request to /v1/auth/login with a JSON body containing your username and password.
access_token to localStorage under the key access_token and redirects you to the home page (/).
Token storage and request headers
The token is persisted inlocalStorage using the key access_token. A request interceptor reads it before every outgoing request and injects it as an Authorization header:
http Axios instance includes the token automatically.
Session expiry and auto-logout
A response interceptor watches every API response for a401 Unauthorized status. When a 401 is received — for example because the token has expired or been invalidated — the interceptor:
- Removes the token from
localStorage(clearAccessToken()) - Redirects the browser to
/loginviawindow.location.href
Protected routes
All routes except/login are wrapped in RequireAuth. This component checks for the presence of access_token in localStorage before rendering any protected content. If no token is found, the user is redirected to /login and the originally requested path is preserved in router state so the app can redirect back after a successful login.
Current user profile
After login, the app callsGET /v1/auth/me to fetch the authenticated user’s profile and role assignments.
Role-based access
ICP System uses three roles. Theroles array returned by /v1/auth/me determines what each user can see and do.
| Role | Access |
|---|---|
ADMIN | Full access to all features, including user management (/usuarios) |
OPERADOR | Standard access plus the Excel import feature (/importacion) |
NOC | Read-only access to monitoring and operational views |
hasRole helper:
roles array and one or more allowed role strings. The function returns true if the user holds at least one of the allowed roles.
Role assignment is managed through the backend. See Users & roles for instructions on creating accounts and assigning roles via the Users page (
/usuarios).