===================================== Testing MfaManager Class ===================================== ✅ Database connected ✅ MfaManager class loaded Using test user ID: 3 ----------------------------------- Test User Found: Name: Managing Director Email: vbdragonspeed@gmail.com Phone: 233203104867 ===================================== TEST 1: Get MFA Settings ===================================== ✅ MFA Settings retrieved: Enabled: No Method: none Phone: 233203104867 Enabled At: 2025-12-07 19:43:10.254719 ===================================== TEST 2: Generate & Send OTP (Email) ===================================== Creating OTP code... ✅ OTP Created: OTP ID: 71 Code: 814627 (DO NOT share this!) Expires: 2025-12-08 01:08:31 (5 minutes) Sending OTP via email... ✅ OTP sent successfully! 📧 Check email: vbdragonspeed@gmail.com ===================================== TEST 3: Verify Wrong OTP Code ===================================== Attempting to verify wrong code: 999999 ✅ Correctly rejected wrong code Error: Invalid verification code. Remaining attempts: 2 ===================================== TEST 4: Verify Correct OTP Code ===================================== Attempting to verify correct code: 814627 ✅ OTP verified successfully! Message: Verification successful ===================================== TEST 5: Verify Used Code (Should Fail) ===================================== ✅ Correctly rejected used code Error: No verification code found. Please request a new one. ===================================== TEST 6: Enable MFA (Email Method) ===================================== ✅ MFA enabled successfully! Message: MFA enabled successfully Backup Codes (SAVE THESE!): 1. 5E8DCE41 2. F0136293 3. D07F6894 4. 03906720 5. FFC5C647 6. 10CFFBE6 7. 05E05C37 8. 7420A2FA ===================================== TEST 7: Check MFA Settings (After Enable) ===================================== Updated MFA Settings: Enabled: Yes ✅ Method: email Enabled At: 2025-12-08 02:03:31.614207 ===================================== TEST 8: Generate & Send OTP (SMS) ===================================== ✅ OTP Created for SMS: Code: 031098 Sending OTP via SMS... ✅ OTP sent via SMS! 📱 Check phone: 233203104867 ===================================== TEST 9: Disable MFA ===================================== ✅ MFA disabled successfully! Message: MFA disabled successfully ===================================== TEST 10: Final MFA Settings Check ===================================== Final MFA Settings: Enabled: No ✅ Method: none ===================================== Test Complete ===================================== Summary: ✅ MfaManager class working ✅ OTP generation working ✅ OTP sending (email) working ✅ OTP verification working ✅ Wrong code rejection working ✅ Used code rejection working ✅ Enable MFA working ✅ Disable MFA working ✅ Backup codes generation working ✅ MFA settings retrieval working Next steps: 1. MfaManager helper class tested ✅ 2. Ready to build MFA APIs! 🚀 Check database: SELECT * FROM ws.user_otp_codes WHERE au_id = 3 ORDER BY created_at DESC LIMIT 5; SELECT * FROM ws.mfa_audit_log WHERE au_id = 3 ORDER BY created_at DESC LIMIT 10;