MFADeviceResponseDTO
Package: @nauth-toolkit/core
Type: DTO (Response)
Outward-facing MFA device information. Maps the internal device entity to the public API shape, translating the internal isPrimary field to the external isPreferred field.
- NestJS
- Express
- Fastify
import { MFADeviceResponseDTO } from '@nauth-toolkit/nestjs';
import { MFADeviceResponseDTO } from '@nauth-toolkit/core';
import { MFADeviceResponseDTO } from '@nauth-toolkit/core';
Properties
| Property | Type | Description |
|---|---|---|
id | number | Unique device identifier |
type | MFADeviceMethod | MFA method type (totp, sms, email, passkey) |
name | string | Device name (user-assigned) |
isPreferred | boolean | Whether this is the preferred device for this method |
isActive | boolean | Whether the device is currently active |
createdAt | Date | Device creation timestamp |
Static Methods
fromEntity()
static fromEntity(device: IMFADevice): MFADeviceResponseDTO
Converts an internal IMFADevice entity to an outward-facing MFADeviceResponseDTO.
fromEntities()
static fromEntities(devices: IMFADevice[]): MFADeviceResponseDTO[]
Converts an array of internal IMFADevice entities to an array of MFADeviceResponseDTO objects.
Example
{
"id": 1,
"type": "totp",
"name": "Google Authenticator",
"isPreferred": true,
"isActive": true,
"createdAt": "2024-01-01T00:00:00.000Z"
}
Used By
Related DTOs
- GetUserDevicesResponseDTO - Contains
devices: MFADeviceResponseDTO[] - GetUserDevicesDTO - Request DTO