Conversation
|
I'm hereby invoking @diegoreymendez + @astralbodies + @aerych for a review. I promise i'll do my best, next time, to cut this into smaller PR's, so i don't drive you crazy. Again. All of the possible login flows have been identified + documented up there. We'll be addressing code duplication between LoginViewController and JetpackSettingsViewController in #3367. Thanks in advance !! |
There was a problem hiding this comment.
Would it make sense to use the term "Path" instead of "URL" for consistency with other NSString path methods?
There was a problem hiding this comment.
Great candidate for a unit test :D
There was a problem hiding this comment.
Updating + adding test. Thank you!
|
So many changes :) |
|
@aerych, @jleandroperez - Just chiming in following what we discussed with @jleandroperez and following @aerych's comment above. I wanted to document the discussion behind the scenes. I'd try to avoid going too deep into style/format checking the old code, since this PR could take ages to wrap up, due to its size and complexity. IMHO, we gotta start dividing functional changes from style or formatting improvements, even though it can be tempting to mix them together. To the point where I'm inclined to propose we start rejecting PRs that fail to do so. My opinion for this PR would be to try and assess it does what it intends to do, so we can merge it sooner and have more people testing it. Thoughts on my comments above? |
|
@aerych + @diegoreymendez to be 100% honest with you... i held myself on many of the missing spots there (ivars being accessed directly // so on), because the code delta was huuuuuge. I'll be (trying to) kill JetpackSettingsViewController in #3367 + nuke manual layout code, plus, perhaps, that'd be a good opportunity to address the missing fixes (ivars, localized strings, so on!). |
|
Spent some time reading through the changes and tested scenarios 1, 2, 4, 5, 6, 9, 10, 11. Looking good so far. Will take it for another spin later and review the remaining scenarios. |
|
@jleandroperez - Tested all cases, and they are working fine for me.
From the usability standpoint though I think this case looks weird (it was already there in the old code):
Expected behavior:
Current behavior:
|
|
Btw - I suggest to wait for @aerych's approval too. |
|
@diegoreymendez + @aerych: Thanks! |
There was a problem hiding this comment.
At the risk of piling on, and also cos @astralbodies's regex hate got me to thinking ;), maybe using NSURLComponents is enough. For instance, [components.scheme hasPrefix:@"http"] is probably sufficient for validating the protocol and [components.host hasSuffix:@wordpress.com"] looks like its sufficient for identifying a wpcom path. Thoughts?
There was a problem hiding this comment.
@aerych updated again, so that we support scenarios like this:
http(s):*.wordpress.com OR http(s)://wordpress.com
Thanks Eric!
|
Sorry @jleandroperez, I consistently crash signing in via scenario 7 in the isWordPressComPath regex check when trying to add "wpt.koke.me" to the app. |
|
@aerych crash should be gone for good, thanks Eric! |
|
Looks like this was the cause:
I entered just the domain for the site. NSURLComponents is interpreting it as the path, not the host, so nil is being passed to the regex check. |
|
Ha! You beat me by 2 seconds :) I'll test the update. |
|
@aerych thanks for spotting the trailing slash + missing protocol glitches!. All should be good now. Thank you! |
|
💥 |
|
@aerych + @diegoreymendez thank you both! |
Multifactor Auth Support
Description:
This pull request implements support for WordPress.com Multifactor Authentication.
Details:
Stats:
multifactorSend code over SMSbutton.Notes:
Closes #3223
Testing Scenarios:
Below, we'll attempt to cover every possible SignIn flow. Please, feel free to add anything that might be missing. Thank you!
Scenario 1: Dotcom Multifactor Disabled
Expected Results:
#### Scenario 2: Dotcom Multifactor Enabled and One Time Code 1. Fresh install WPiOS 2. Enter the Username / Password of a DotCom account with 2FA enabled
Expected Results:
#### Scenario 3: Dotcom Multifactor Enabled and One Time Code via SMS 1. Fresh install WPiOS 2. Enter the Username / Password of a DotCom account with 2FA enabled 3. When visible, tap over the `Send one time code via Text Message` button. 4. Once the SMS has been received, proceed entering the code.
Expected Results:
#### Scenario 4: Dotcom Multifactor Enabled and App Password 1. Fresh install WPiOS 2. Enter the Username + Application Specific Password
Expected Results:
#### Scenario 5: Dotcom as "Self Hosted" 1. Fresh install WPiOS 2. Tap over `Add Self-Hosted Site` 3. In the `Site URL` enter WordPress.com 4. Enter your WordPress.com credentials
NOTE:
1..4. Please, repeat all of them, but make sure to perform the extra step of specifying WordPress.com as an endpoint.Expected Results:
#### Scenario 6: Self Hosted with no Jetpack 1. Fresh install WPiOS 2. Tap over `Add Self-Hosted Site` 3. Log into a Self Hosted WordPress blog with Jetpack disabled / unavailable
Expected Results:
#### Scenario 7: Self Hosted with Jetpack 1. Fresh install WPiOS 2. Tap over `Add Self-Hosted Site` 3. Log into a Self Hosted WordPress blog with Jetpack Enabled
NOTE:
1..4, please, make sure that Jetpack Login pass'ess those tests as well.Expected Results:
#### Scenario 8: Re-Login Flow 1. WPiOS: Fresh install the app 2. WPiOS: Log into a WordPress.com account 3. WordPress.com: Log into the same account as in step 2 4. WordPress.com: Open Account Settings > Security 5. WordPress.com: In the 'Connected Applications', remove the connection for WordPress iOS App 6. WPiOS: In My Sites tab, try opening the Posts / Comments
Expected Results:
#### Scenario 9: Connect Dotcom with Self Hosted already wired (Me tab) 1. WPiOS: Fresh install the app 2. WPiOS: Log into a Self Hosted blog 3. Skip Jetpack Setup 4. Tap over `Me` tab, and press `Connect to WordPress.com Account`
Expected Results:
#### Scenario 10: Connect Dotcom with Self Hosted already wired (My Sites tab) 1. WPiOS: Fresh install the app 2. WPiOS: Log into a Self Hosted blog 3. Skip Jetpack Setup 4. Tap over `My Sites` tab, and press `Add a Site`
Expected Results:
#### Scenario 11: Add Self Hosted Blog 1. WPiOS: Fresh install the app 2. WPiOS: Log into a WordPress.com account 3. Tap over `My Sites` tab, and press `Add a Site`
Expected Results: