wordpress-mobile / WordPress-Login-Flow-Android

Pluggable WordPress login flow for Android
GNU General Public License v2.0
14 stars 3 forks source link

Fix Smart Lock Login with 2FA issue #136

Closed irfano closed 3 months ago

irfano commented 3 months ago

2FA case was handled as an auth error in LoginUsernamePasswordFragment. But FluxC is dispatching OnTwoFactorAuthStarted event instead of an auth error. I subscribed FluxC event to handle the 2FA case in LoginUsernamePasswordFragment.

Test this PR on WordPress-Android's trunk.

Before video It is stuck at loading.

before-video.webm

To Test: Can be tested on https://github.com/wordpress-mobile/WordPress-Android/pull/20102

  1. Have a WP account with 2FA enabled.
  2. The account should be saved on your Smart Lock Login.
  3. Log in to JP with the Smart Lock Login option.
  4. Verify it requests the verification code and enter the verification code.
  5. Verify it logs in successfully.
irfano commented 3 months ago

Yes, @ravishanker. I published a release and upgraded the version on WordPress-Android. I find opening WordPress-Android PR after publishing a lib release easier for this repo.