In this tutorial, we built a Flutter app that uses Supabase for authentication and implements multi-factor authentication (MFA) using time-based one-time passwords (TOTP). The app includes the following features:
1. Registration page with email verification
2. Login page with MFA setup option
3. Home page with secure contents that require MFA to view
4. List of MFA factors and unenrollment page
5. Go router for handling routing and redirection based on user authentication status
To achieve this, we used the following packages:
- `flutter_dotenv`: To manage environment variables in Flutter apps
- `go_router`: For managing app navigation and routing
- `supabase_flutter`: For integrating Supabase with our Flutter app
We also utilized some key features of Supabase, such as email verification, MFA setup, and row-level security (RLS) to secure the data.