Skip to main content

AdminGetUserAuthHistoryDTO

Package: @nauth-toolkit/core Type: DTO (Request) Context: Admin Only

Request DTO for getting paginated authentication history for any user (admin operation) with optional filtering by event types, status, and date ranges.

Admin Only

This DTO requires the sub field to specify the target user. It extends GetUserAuthHistoryDTO and adds the sub field. For user self-service operations, use GetUserAuthHistoryDTO instead.

import { AdminGetUserAuthHistoryDTO } from '@nauth-toolkit/nestjs';

Properties

This DTO extends GetUserAuthHistoryDTO and adds the following required field:

PropertyTypeRequiredDescription
substringYesUser's unique identifier (UUID v4). Trimmed and lowercased.
pagenumberNoPage number (1-indexed). Default: 1
limitnumberNoNumber of records per page. Default: 50. Max: 500.
startDateDateNoFilter events from this date onwards
endDateDateNoFilter events up to this date
eventTypesAuthAuditEventType[]NoFilter by specific event types
eventStatusAuthAuditEventStatus[]NoFilter by event status. Allowed: SUCCESS, FAILURE, INFO, SUSPICIOUS.

Example

{
"sub": "550e8400-e29b-41d4-a716-446655440000",
"page": 1,
"limit": 50,
"eventTypes": ["LOGIN_SUCCESS", "LOGIN_FAILED"],
"startDate": "2025-01-01T00:00:00.000Z"
}

Used By