Get user access history
GET/company/users/access/:id
Returns the login history of a specific user with detailed information on IP, browser, operating system, and geolocation.
Objective
To facilitate security auditing and detection of suspicious access by analyzing access patterns.
Use Cases
- Security auditing
- Detection of access from unusual locations
- Analysis of devices used
- Investigation of unauthorized access
Authentication
- Requires a valid JWT (middleware m.isLoged)
Response Data
Each access record includes:
- IP address
- Browser (name, version)
- OS (name, version)
- Device (name, version)
- Geolocation (country, region, city, timezone)
Geolocation
- Uses geoip-lite to determine location from IP
- May not be available for all IPs (private, VPN, etc.)
Pagination
- Returns paginated results
- Parameters: page, limit
Request
Responses
- 200
- 401
- 404
Access history retrieved successfully.
Unauthorized. Possible causes:
- Invalid or expired JWT token
User not found