-
Notifications
You must be signed in to change notification settings - Fork 5
feat(M2-9998): add multi-factor authentication (MFA) login support #2181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add TOTP and recovery code verification flows - Implement MFA session management with 5 minute expiry - Add rate limiting with 5 attempt maximum - Create reusable MFA form components with auto-submit - Add comprehensive error handling and user feedback - Include English and French translations - Add unit tests for all MFA components
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
- Create MFA-specific styled components separate from login styles - Fix container dimensions (473px width) and centering - Remove input masks and fix cursor positioning - Update all text to match design requirements - Remove link underlines and reposition Back button - Update tests to match new UI text
- Move error formatting logic from component to Redux state to persist through re-renders - Add displayError field to MFAVerificationState for pre-formatted error messages - Fix race condition when clearing input after failed verification attempts - Handle "MFA session not found or expired" error for recovery codes - Show attempt count after 3 failed TOTP attempts (e.g., "2 attempts remaining") - Update tests to match new error handling approach - Update MFA implementation documentation
…account settings)
…how Back to Log In on recovery
divbzero
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good! Follows our general MFA design as well as OWASP recommendations.
Please see comments for a few requested changes around:
- Deduping
hasValidResultandformatRecoveryCodefunctions - Reusing components when possible instead of defining new styled components
- Removing custom letter-spacing on recovery code
<input>for consistency - Removing
console.logdebug statement
divbzero
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Thank you so much, going to merge now. |
PR Description - MFA Implementation
🎯 Summary
Implements Multi-Factor Authentication (MFA) for enhanced login security in MindLogger Admin. Users with MFA enabled must provide a 6-digit TOTP code or recovery code after entering their credentials.
Jira Main
Jira Ticket: M2-9998
Sub Tasks Fixed:
Jira Ticket: M2-10194
Jira Ticket: M2-10195
Jira Ticket: M2-10196 ✨ NEW
🔧 Changes
Core Features
Technical Implementation
useMFAVerificationprovides shared logic for both formsComponents Added
AuthFlow: Main authentication flow controller with session trackingMFAForm: TOTP code entry form with inline error displayRecoveryCodeForm: Recovery code entry form with auto-formattinguseMFAVerification: Custom hook for verification logicmfa.utils: Error mapping utilities for user-friendly messagesBug Fixes (M2-10196)
Video
https://www.loom.com/share/d2bb4f21fdfe46b38b76baaf6c766d46
Screenshots
MFA Flow
|
|
|
|
|
✅ Testing
useMFAVerification.test.tsx)🔐 Security Considerations
🌐 Internationalization
Added translations for:
app-en.json)app-fr.json)Key translations:
invalidCode,mfaSessionExpired,tooManyAttemptsconfirmYourIdentity,enterVerificationCode,backToLogin📚 Documentation
🚀 How to Test
⚡ Performance
🔄 Backwards Compatibility
📝 Checklist