Skip to content
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

[Login] Use Magic Link for suspicious emails [Part 2] #13345

Conversation

hichamboushaba
Copy link
Member

@hichamboushaba hichamboushaba commented Jan 17, 2025

Closes: #13341

Depends on wordpress-mobile/WordPress-Login-Flow-Android#157

Description

This PR updates the login library to bring the changes of the above PR, which updates the Magic Link screens to show a correct button when used in the suspicious email flow.
The PR also updates our current LoginMagicLinkSentImprovedFragment with the same changes.

Steps to reproduce

  1. With the app already signed in, open ApiFaker and add a fake matching the following:
Endpoint type: WordPress.com
Endpoint path: /v1.1/users/%/auth_options
Response status code: 403
Response body: 
{
        "error": "email_login_not_allowed",
        "message": "Please log in using your WordPress.com username instead of your email address."
}
  1. Logout
  2. Enter the address of a Jetpack connected site
  3. Enter email address of a WordPress.com account

Testing information

  • Confirm that Magic Link request screen shows a button "Use username and password instead"
  • Confirm the behavior of the button.
  • Do the same for the "Magic Links sent" screen.
  • Confirm the following tracking when tapping on the button:
    woocommerceandroid_unified_login_interaction, Properties:{"flow":"login_magic_link", "step":"start", "click":"login_with_wp_com_username_password"}

The tests that have been performed

^

Images/gif

  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

Reviewer (or Author, in the case of optional code reviews):

Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement:

  • The PR is small and has a clear, single focus, or a valid explanation is provided in the description. If needed, please request to split it into smaller PRs.
  • Ensure Adequate Unit Test Coverage: The changes are reasonably covered by unit tests or an explanation is provided in the PR description.
  • Manual Testing: The author listed all the tests they ran, including smoke tests when needed (e.g., for refactorings). The reviewer confirmed that the PR works as expected on big (tablet) and small (phone) in case of UI changes, and no regressions are added.

@hichamboushaba hichamboushaba added status: do not merge Dependent on another PR, ready for review but not ready for merge. feature: login Related to any part of the log in or sign in flow, or authentication. labels Jan 17, 2025
@dangermattic
Copy link
Collaborator

dangermattic commented Jan 17, 2025

1 Error
🚫 Please ensure the PR has the category: tracks label.
1 Message
📖

This PR contains changes to Tracks-related logic. Please ensure (author and reviewer) the following are completed:

  • The tracks events must be validated in the Tracks system.
  • Verify the internal Tracks spreadsheet has also been updated.
  • Please consider registering any new events.
  • The PR must be assigned the category: tracks label.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jan 17, 2025

Project dependencies changes

The following changes in project dependencies were detected (configuration vanillaReleaseRuntimeClasspath):

list
Upgraded Dependencies
org.wordpress:login:157-2b5183bb47cd6f53738862849e31c4efcad52ed0, (changed from 156-98aa2c6174009b24253133b6733be119b70b7178)
tree
-\--- org.wordpress:login:156-98aa2c6174009b24253133b6733be119b70b7178
+\--- org.wordpress:login:157-2b5183bb47cd6f53738862849e31c4efcad52ed0

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jan 17, 2025

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App Name WooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commit183bee9
Direct Downloadwoocommerce-wear-prototype-build-pr13345-183bee9.apk

@hichamboushaba hichamboushaba force-pushed the issue/13341-magic-link-suspicious-emails branch from 557c816 to 4621b77 Compare January 17, 2025 15:57
@hichamboushaba hichamboushaba changed the title Issue/13341 magic link suspicious emails [Login] Use Magic Link for suspicious emails [Part 2] Jan 17, 2025
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jan 17, 2025

📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.

App Name WooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commit3587e1e
Direct Downloadwoocommerce-prototype-build-pr13345-3587e1e.apk

@hichamboushaba hichamboushaba marked this pull request as ready for review January 20, 2025 09:31
@hichamboushaba hichamboushaba requested a review from a team as a code owner January 20, 2025 11:10
@hafizrahman hafizrahman self-assigned this Jan 21, 2025
Copy link
Contributor

@hafizrahman hafizrahman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM since I already tested it on the other PR wordpress-mobile/WordPress-Login-Flow-Android#157

Code looks good, nice details with updating Java-style var names too.

@hichamboushaba hichamboushaba removed the status: do not merge Dependent on another PR, ready for review but not ready for merge. label Jan 21, 2025
@hichamboushaba hichamboushaba added this to the 21.5 milestone Jan 21, 2025
@hichamboushaba hichamboushaba merged commit abaa28a into issue/13321-magic-link-suspicious-emails Jan 21, 2025
3 of 5 checks passed
@hichamboushaba hichamboushaba deleted the issue/13341-magic-link-suspicious-emails branch January 21, 2025 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: login Related to any part of the log in or sign in flow, or authentication.
Projects
None yet
4 participants