Skip to content

Conversation

@mindgraffiti
Copy link
Contributor

@mindgraffiti mindgraffiti commented Apr 27, 2020

Ref. #2003

This PR removes the segue .startMagicLinkFlow that sends a user to the "Send Magic Link?" screen. It now navigates the user programmatically.

Main PR changes here: wordpress-mobile/WordPressAuthenticator-iOS#256

To test

  1. Check out this branch
  2. rake dependencies
  3. Build and run
  4. Log out if logged in
  5. Log in with Jetpack > enter email address > next
  6. Expected: the Magic Link screen will appear
  7. Send Link > open the magic link*
  8. Expected: you are successfully navigated to the store list screen

Step 7 Note: If 2fa is active for a non-Automattic account, the magic link will ask for a 2fa code first. If the code is correct, then it will redirect you and reopen the WordPress app. If your login is an Automattic email account, you will be blocked from sending magic links.

Do not merge until:

  1. The Authenticator PR has been merged: UL&S: Remove .startMagicLinkFlow segue wordpress-mobile/WordPressAuthenticator-iOS#256 ✔️
  2. A new Authenticator release has been created ✔️
  3. The release is published on Cocoapods trunk ✔️
  4. This PR points to the new release ✔️

Update release notes:

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Update WordPressUI version to match Authenticator's dependency
@mindgraffiti mindgraffiti added type: enhancement A request for an enhancement. feature: login Related to any part of the log in or sign in flow, or authentication. labels Apr 27, 2020
@mindgraffiti mindgraffiti added this to the 4.2 milestone Apr 27, 2020
@mindgraffiti mindgraffiti requested review from pmusolino and shiki April 27, 2020 17:06
@peril-woocommerce
Copy link

peril-woocommerce bot commented Apr 27, 2020

You can trigger an installable build for these changes by visiting CircleCI here.

@pmusolino pmusolino self-assigned this Apr 28, 2020
Copy link
Contributor

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

Thanks, Thuy! LGTM, I've just some observations, probably not strictly related to this PR.

Code ✅
Testing:

if 2fa is active, the magic link will ask for a 2fa code first. If the code is correct, then it will redirect you and reopen the WordPress app

This is my case. I used my Automattic email, but I wasn't able to use the magic link, I stumbled upon this issue wordpress-mobile/WordPressAuthenticator-iOS#39
I tried to use another account where 2FA is not enabled, and everything worked as expected.

Another thing, that is not related to this PR, but it's the first time that I notice it. I don't know why, but I'm unable to add my email address typing it with my physical keyboard. I've to use the virtual keyboard in the simulator. This is new to me, since before I always added my email address typing it using my MacBook Pro keyboard.

@mindgraffiti
Copy link
Contributor Author

Thanks @pmusolino!

  1. I updated the testing instructions to explain that Automattic accounts can't use magic links if 2fa is enabled. Try testing with an @gmail.com email account if you have one.
  2. I don't know why, but I'm unable to add my email address typing it with my physical keyboard. There is a bug in the simulators. If you're testing one of the "numbered" phones (iPhone 11, iPhone 11 Pro, iPhone 8, etc.) the simulator will sometimes fail to attach several commands. You can verify the simulator is buggy by attempting to take a screenshot using key commands (⌘+s), which fails. Sometimes a temporary fix is to toggle the keyboard on / off. So if you're trying to get the hardware keyboard to connect, use (⇧⌘+k) or go to the menu I/O > Keyboard > Connect Hardware Keyboard. Turn it off and turn it on again 😆

I haven't found a permanent fix to the simulator issue. I've deleted Xcode and all Sims and re-installed them. I've tried resetting the content in the sims. I've tried quitting the sims and restarting the app. No luck.

@pmusolino
Copy link
Contributor

I updated the testing instructions to explain that Automattic accounts can't use magic links if 2fa is enabled. Try testing with an @gmail.com email account if you have one.

TIL 👍 with another Gmail account, everything is OK 💯

I don't know why, but I'm unable to add my email address typing it with my physical keyboard. There is a bug in the simulators. If you're testing one of the "numbered" phones (iPhone 11, iPhone 11 Pro, iPhone 8, etc.) the simulator will sometimes fail to attach several commands. You can verify the simulator is buggy by attempting to take a screenshot using key commands (⌘+s), which fails. Sometimes a temporary fix is to toggle the keyboard on / off. So if you're trying to get the hardware keyboard to connect, use (⇧⌘+k) or go to the menu I/O > Keyboard > Connect Hardware Keyboard. Turn it off and turn it on again

It seems that this happens only in the login flow on an iPhone 11 Pro Max (iOS 13.4) in my case 😆 maybe because the UI is under another bundle? Anyway, don't worry about it 😉 it's an Apple bug.

@pmusolino
Copy link
Contributor

It seems that this happens only in the login flow on an iPhone 11 Pro Max (iOS 13.4) in my case

Forgot what I said, it's not only in the login flow 😄 now it happens also in other screens. It's the first time that I see this issue. I've only been lucky so far.

@mindgraffiti mindgraffiti merged commit e0370fd into develop Apr 28, 2020
@mindgraffiti mindgraffiti deleted the issue/2003-remove-segue-startMagicLinkFlow branch April 28, 2020 16:16
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: enhancement A request for an enhancement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants