AdminSetPreferredDeviceDTO
Package: @nauth-toolkit/core
Type: DTO (Request)
Context: Admin Only
Request DTO for setting a specific MFA device as preferred for a user (admin operation).
Admin Only
This DTO requires both sub and deviceId. For user self-service, use MFAService.setPreferredDevice() which derives user from context.
- NestJS
- Express
- Fastify
import { AdminSetPreferredDeviceDTO } from '@nauth-toolkit/nestjs';
import { AdminSetPreferredDeviceDTO } from '@nauth-toolkit/core';
import { AdminSetPreferredDeviceDTO } from '@nauth-toolkit/core';
Properties
| Property | Type | Required | Description |
|---|---|---|---|
deviceId | number | Yes | MFA device ID to set as preferred. Must be positive integer. Auto-converted from string. |
sub | string | Yes | Target user identifier. |
Example
{
"sub": "a21b654c-2746-4168-acee-c175083a65cd",
"deviceId": 123
}
Used By
Related DTOs
- AdminSetPreferredDeviceResponseDTO - Response DTO
- SetPreferredDeviceDTO - Self-service request DTO
Response
AdminSetPreferredDeviceResponseDTO
| Property | Type | Description |
|---|---|---|
message | string | Success message |
Example Response:
{
"message": "Preferred MFA device updated"
}