Remember this device with trusted-device tokens
Skip MFA on familiar browsers without compromising security.
When the user verifies MFA, give them the option to "trust this device for 14 days." On their next login, MFA is auto-skipped on the same browser.
Server config
In the MFA challenge UI
When trustDevice: true, the response carries a trustToken. The library client persists it and sends it on every login attempt thereafter.
What the server sees
On the next login, the request carries the trust token in the nest_auth_device_trust header. If the token is valid and not expired, MFA is skipped — login completes immediately.
The server records the device in nest_auth_trusted_devices with userAgent and ipAddress. Build a "manage trusted devices" UI by listing those rows.
Make sure CORS allows the header
Browsers strip unknown headers in preflight; if this is missing, the trust token never reaches the server and every login re-prompts for MFA.
Revoking trust
If the user clicks "remove this device," delete the matching row in nest_auth_trusted_devices. The next request from that device will require MFA again.