GetUserAuthHistoryDTO
Package: @nauth-toolkit/core
Type: DTO (Request)
Context: User Self-Service
Request DTO for getting paginated authentication history for the current authenticated user with optional filtering by event types, status, and date ranges.
User Self-Service
This DTO is for user self-service operations. The sub is automatically derived from the authenticated user's context. For admin operations, use AdminGetUserAuthHistoryDTO instead.
- NestJS
- Express
- Fastify
import { GetUserAuthHistoryDTO } from '@nauth-toolkit/nestjs';
import { GetUserAuthHistoryDTO } from '@nauth-toolkit/core';
import { GetUserAuthHistoryDTO } from '@nauth-toolkit/core';
Properties
| Property | Type | Required | Description |
|---|---|---|---|
page | number | No | Page number (1-indexed). Default: 1 |
limit | number | No | Number of records per page. Default: 50. Max: 500. |
startDate | Date | No | Filter events from this date onwards |
endDate | Date | No | Filter events up to this date |
eventTypes | AuthAuditEventType[] | No | Filter by specific event types |
eventStatus | AuthAuditEventStatus[] | No | Filter by event status. Allowed: SUCCESS, FAILURE, INFO, SUSPICIOUS. |
note
The sub field is not included in this DTO. It is automatically derived from the authenticated user's context when using AuthService.getUserAuthHistory().
Example
{
"page": 1,
"limit": 50,
"eventTypes": ["LOGIN_SUCCESS", "LOGIN_FAILED"],
"startDate": "2025-01-01T00:00:00.000Z"
}
Used By
- AuthService.getUserAuthHistory() - User self-service method
Related DTOs
- AdminGetUserAuthHistoryDTO - Admin version with
subfield
Related APIs
- AuthAuditEventType - Complete list of event types
- AuthAuditEventStatus - Event status values