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
otpauthandqrcodepeer dependencies - Creating a migration for TOTP-related columns on the users table
- Adding the
withTotpManagementmixin 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.