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] Fix issue of showing the password fallback button for passwordless accounts #13201

Merged
merged 1 commit into from
Jan 2, 2025

Conversation

hichamboushaba
Copy link
Member

@hichamboushaba hichamboushaba commented Dec 25, 2024

Closes: #13187

Description

This PR fixes a long standing bug that we had in the app, since the introduction of the magic link experiment more than 2 years ago, we accidentally ignored the allowPassword argument, and this issue persisted after removing the experiment and also after introducing QR code scanning feature.

Steps to reproduce

  1. Use a passwordless account (or alternatively use the ApiFaker to fake the endpoint /v1.1/users/%/auth-options to return {"passwordless": true, "email_verified": true })
  2. Log out, then log in.
  3. Check the magic link screen.

Testing information

Confirm that the button "Or log in with password" is hidden.

The tests that have been performed

^

  • 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.

To make sure the password fallback button is hidden when the account is passwordless
@hichamboushaba hichamboushaba added type: bug A confirmed bug. feature: login Related to any part of the log in or sign in flow, or authentication. labels Dec 25, 2024
@hichamboushaba hichamboushaba added this to the 21.4 milestone Dec 25, 2024
@hichamboushaba hichamboushaba requested review from JorgeMucientes, irfano and hafizrahman and removed request for JorgeMucientes December 25, 2024 11:55
@wpmobilebot
Copy link
Collaborator

📲 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
Commita04fb27
Direct Downloadwoocommerce-wear-prototype-build-pr13201-a04fb27.apk

@wpmobilebot
Copy link
Collaborator

📲 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
Commita04fb27
Direct Downloadwoocommerce-prototype-build-pr13201-a04fb27.apk

@irfano irfano self-assigned this Dec 26, 2024
Copy link
Contributor

@irfano irfano left a comment

Choose a reason for hiding this comment

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

Thanks for addressing this issue, @hichamboushaba! I have a question. I was able to trigger magic link with my account that has a password, and the "Log in with magic link" button was useful in this case. This PR removes the button not only for passwordless accounts but for all accounts. Was this intentional?
Still, a user with a password can navigate back from the magic link screen to the password screen by tapping the back button. Do you think this is fine, or should we check isPasswordless state and remove the "Log in with magic link" button based on that?

before after

@hichamboushaba
Copy link
Member Author

I have a question. I was able to trigger magic link with my account that has a password, and the "Log in with magic link" button was useful in this case. This PR removes the button not only for passwordless accounts but for all accounts. Was this intentional?

Thanks @irfano for the review, and sorry for the late reply.
All I did is to revert to the original behavior, having the button shown before was a side effect of the bug, as the logic we have in the app (a very old logic actually) is to not show it.

Whether the button should be shown or not is a different discussion, personally I think it shouldn't because the user intentionally opened the screen and can use the back button to revert his decision. But my opinion is not a strong one, so if you believe we should change the behavior, we can start a discussion separately; the discussion also allows us to keep the platforms aligned (iOS doesn't show it either).

Copy link
Contributor

@irfano irfano left a comment

Choose a reason for hiding this comment

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

Thanks for the explanation, Hicham. Then we can proceed with merging this and aligning the platforms. LGTM! 👍🏻

@irfano irfano merged commit c93c483 into trunk Jan 2, 2025
17 of 19 checks passed
@irfano irfano deleted the issue/13187-fix-magic-link-screen branch January 2, 2025 23:34
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. type: bug A confirmed bug.