===================================== 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-05 04:57:38.64633 ===================================== TEST 2: Generate & Send OTP (Email) ===================================== Creating OTP code... ✅ OTP Created: OTP ID: 59 Code: 468863 (DO NOT share this!) Expires: 2025-12-05 11:11:45 (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: 468863 ✅ 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. 86A43F8E 2. 85240F03 3. 6D9D2274 4. CBD55E6E 5. 5906C161 6. E8AF7FC2 7. BB629B16 8. F451DE3F ===================================== TEST 7: Check MFA Settings (After Enable) ===================================== Updated MFA Settings: Enabled: Yes ✅ Method: email Enabled At: 2025-12-05 12:06:46.246216 ===================================== TEST 8: Generate & Send OTP (SMS) ===================================== ✅ OTP Created for SMS: Code: 290841 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;