React

Setup

At the end of this guide, you will have your application configured and ready to use all Two-Factor Auth components.

This guide walks you through installing the required peer dependencies, creating a database migration for TOTP columns, and configuring your User model with the withTotpManagement mixin. All subsequent two-factor guides build on this foundation.

The setup includes:

  • Installing otpauth and qrcode peer dependencies
  • Creating a migration for TOTP-related columns on the users table
  • Adding the withTotpManagement mixin to the User model
  • Updating the user transformer with 2FA status
  • Adding validators for TOTP codes and recovery codes
Note

This guide requires you to complete the Auth Setup guide first.

Unlock access
Only Plus subscribers can access the documentation
Log in now