wordpress-mobile / wordpress-mobile/WordPress-Android
QR Login: Detect if 2FA is turned on and warn user
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 3.2k
- Forks
- 1.4k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 69
Description
QR Login isn't available for accounts with 2FA. It would be nice if we could detect if 2FA is enabled and warn the user.
- Slack ref: p1664879201895099/1664874812.012369-slack-C0180B5PRJ4
- iOS issue: https://github.com/wordpress-mobile/WordPress-iOS/issues/19397
Options
(1) Handle this on the clients before/after scanning. The QR code login flow is not required to start within the app; the device camera or a scanning app can start the flow.
two_step_enabledis part of AccountSettings and does not exist in the AccountModel. FluxC changes are required to add this information to the AccountModel.- The check for 2FA disabled can be made after "Scan Login Code" is tapped on the Me menu (before it goes into scanning mode). Show an error toast.
- If the QR code is scanned from the camera, not Me -> Scan Login Code, the user gets dumped into the scan flow and will see an error message. We'll need to adjust the error message about 2FA
OR
(2) Enhance the endpoint and return a new error code to indicate that 2FA is not enabled. Use this code to show an explicit "2FA" error message after scanning (the error view already exists)
OR
(3) An authentication error view is currently show in the QR login flow when auth fails. Update the web site to include a message that 2FA enabled accounts are not eligible to use the qr code login process. This messaging can be added to the "Login via the mobile app" view. This option requires no client changes.

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the QR login flow, the Me menu's "Scan Login Code" entry, AccountSettings, AccountModel, FluxC, and the existing authentication error view. The issue presents three possible approaches, so confirm the intended client, endpoint, or website scope before changing anything. Done should include a clear warning for accounts with 2FA enabled, including QR scans started outside the Me menu.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- authentication, mobile
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100