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

Support WordPress.com magic link login #24260

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

crazytonyli
Copy link
Contributor

Fixes #24171.

This PR implements the option 1 in issue #24171.

Regression Notes

  1. Potential unintended areas of impact

  2. What I did to test those areas of impact (or what existing automated tests I relied on)

  3. What automated tests I added (or what prevented me from doing so)

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Testing checklist:

  • WordPress.com sites and self-hosted Jetpack sites.
  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • VoiceOver.
  • Languages with large words or with letters/accents not frequently used in English.
  • Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • iPhone and iPad.
  • Multi-tasking: Split view and Slide over. (iPad)

@crazytonyli crazytonyli added this to the 25.9 milestone Mar 19, 2025
@dangermattic
Copy link
Collaborator

1 Warning
⚠️ This PR is assigned to the milestone 25.9. The due date for this milestone has already passed.
Please assign it to a milestone with a later deadline or check whether the release for this milestone has already been finished.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Mar 19, 2025

WordPress Alpha📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
App NameWordPress Alpha WordPress Alpha
ConfigurationRelease-Alpha
Build Numberpr24260-04cd083
Version25.8
Bundle IDorg.wordpress.alpha
Commit04cd083
App Center BuildWPiOS - One-Offs #11775
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Mar 19, 2025

Jetpack Alpha📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
App NameJetpack Alpha Jetpack Alpha
ConfigurationRelease-Alpha
Build Numberpr24260-04cd083
Version25.8
Bundle IDcom.jetpack.alpha
Commit04cd083
App Center Buildjetpack-installable-builds #10801
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@pmusolino pmusolino self-assigned this Mar 20, 2025
Copy link
Member

@pmusolino pmusolino left a comment

Choose a reason for hiding this comment

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

Hey Tony, thanks for working on this issue, because I encountered the same issue few days ago.

While testing this PR, I encountered a blocking issue. If you follow these steps, you will not be able to log in with the magic link:

  1. I created a new account in the app and logged in automatically.
  2. I logged out (also in the webview).
  3. I attempted to log in again.
  4. I reached the view where I was asked to receive the magic link and pressed the button to receive the email.
  5. I received the email and copy-pasted the link into Safari within the simulator.
  6. I logged into the webview, then I was redirected to the app using the deeplink.
  7. I got stuck on the previous view that asked me to check my email, and after closing it, I remained unauthenticated.

@crazytonyli crazytonyli force-pushed the web-login-support-app-redirect branch from ef5ca1f to 04cd083 Compare March 20, 2025 22:43
@crazytonyli
Copy link
Contributor Author

@pmusolino Good catch! That bug slipped through after a code refactor. I have fixed the issue and have added an unit test to cover logging in via login links.

@pmusolino pmusolino self-requested a review March 21, 2025 11:54
Copy link
Member

@pmusolino pmusolino left a comment

Choose a reason for hiding this comment

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

Thank you Tony, now it works as expected!

I just found an additional issue. Since you have more knowledge than me in login, I'm not sure it's strictly related to this PR, and it's probably how the magic link is handled on the web. Basically, if I'm already logged in on the browser (Safari), the magic link doesn't work and does not redirect me to the app, making it impossible to log in properly in the app. Wdyt?

@kean
Copy link
Contributor

kean commented Mar 21, 2025

It worked but not exactly the way I would've expect. Some of these issues are web-specific and might be worth reporting and fixing before shipping it.

  1. The "Authorize your account" screen was shown in a browser – I'd probably expect it to be shown in the app (ideally not at all).
  2. The screen says "WordPress for iOS". I was logging it from "Jetpack".
  3. I was logged out in the browser and for some reason it logged me in – that was not my intention.
  1. No email auto-completion on the following screen:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A newly signed up user can't log in via web-based dotcom login
5 participants