Skip to main content

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.

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

Properties

PropertyTypeRequiredDescription
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.
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