Skip to main content

Trusted Device DTOs

Package: @nauth-toolkit/core Type: DTO (Request/Response)

Cover listing and revoking the devices allowed to skip MFA. Enrolling a device returns TrustDeviceResponseDTO; these are the management operations that pair with it.

import { ListTrustedDevicesResponseDTO, RevokeTrustedDeviceDTO } from '@nauth-toolkit/nestjs';

TrustedDeviceResponseDTO​

One trusted device. Deliberately omits deviceTokenHash — the plaintext token is held only by the device itself, and its hash is never useful to a client.

PropertyTypeRequiredDescription
browserstring | nullNoBrowser reported by the device.
createdAtDateYesWhen the device was trusted.
deviceIdstring | nullNoClient-supplied device identifier, when the client sends one.
deviceNamestring | nullNoHuman-readable device label.
deviceTypestring | nullNoDevice form factor (e.g. mobile, desktop).
idnumberYesRecord id. Identifies the device when revoking it.
ipAddressstring | nullNoIP address the device was trusted from.
lastUsedAtDate | nullNoLast authentication, or null if unused since being trusted.
platformstring | nullNoOperating system reported by the device.
trustedUntilDateYesWhen the trust expires. Devices past this point are never listed.

ListTrustedDevicesResponseDTO​

PropertyTypeRequiredDescription
trustedDevicesTrustedDeviceResponseDTO[]YesUnexpired trusted devices, most recently used first.

RevokeTrustedDeviceDTO​

Self-service revocation. The device is the caller's own, resolved from request context, so no user identifier is sent.

PropertyTypeRequiredDescription
deviceIdnumberYesTrusted device record id. Positive integer.

AdminRevokeTrustedDeviceDTO​

PropertyTypeRequiredDescription
deviceIdnumberYesTrusted device record id. Positive integer.
substringYesTarget user sub. UUID v4, trimmed and lowercased.

AdminManageTrustedDevicesDTO​

PropertyTypeRequiredDescription
substringYesTarget user sub. UUID v4, trimmed and lowercased.

RevokeTrustedDeviceResponseDTO​

PropertyTypeRequiredDescription
successbooleanYesWhether a matching device was found and revoked.

RevokeAllTrustedDevicesResponseDTO​

PropertyTypeRequiredDescription
revokedCountnumberYesHow many devices were revoked.

Example​

{
"trustedDevices": [
{
"id": 7,
"deviceName": "Work laptop",
"deviceType": "desktop",
"platform": "macOS",
"browser": "Chrome",
"ipAddress": "203.0.113.5",
"trustedUntil": "2026-04-01T00:00:00.000Z",
"lastUsedAt": "2026-03-05T09:12:00.000Z",
"createdAt": "2026-03-01T00:00:00.000Z"
}
]
}

Used By​