Part 3: Sign In post authentication validate url and auto-login#1135
Part 3: Sign In post authentication validate url and auto-login#1135anitaa1990 merged 28 commits intofeature/signin-milestone-1from
Conversation
This is needed so we can access this url no matter the login method a user uses.
Store name is not available for sites not connected to the authenticated account.
Setting the theme-level buttonstyle to a borderless button was causing conflicts with other button styles (such as the white button).
The continue button would disappear if you rotated the device.
This prevents some odd behavior where if the app is closed on the site picker screen it doesn't remember the login by url settings
Generated by 🚫 dangerJS |
The method is now handled by the SitePickerPresenter because that makes more sense.
…set()" This reverts commit 821a1be
This was due to the login url still being present in AppPrefs. Now we delete this value on successful login.
anitaa1990
left a comment
There was a problem hiding this comment.
I tested the following scenarios with a couple of ninja sites:
- Entered username that does not match the test site and username is not connected with any stores
- Entered username that does not match the test site but username is connected with other stores
- Entered site without Jetpack installed
- Entered site with Jetpack installed and correct username but no Woo installed
- Entered site with correct username and Woo installed.
Everything works great! A couple of minor things I found:
- After successfully logging in, when I click back from the Dashboard screen, the Login page is still visible.
- I get this error message when entering an email address that is not associated with any WP.com account. I am not sure this error message is relevant since we no longer have the site address option in this page.
I am not sure if I missed any other scenarios but @nbradbury could I trouble you to review this as well, since you might have better insights on Login?
|
@anitaa1990 Thank you for the thorough review!
I was unable to reproduce this. Which method of login did you use? What device were you testing on? Maybe it's API/device specific.
Very good catch! I have a fix in mind, but am waiting on approval from @kyleaparker This is the screen I have in mind as a replacement: My proposed fix would remove the part of the error string that is no longer applicable and add a "Need help finding connected email?" button. |
|
@anitaa1990 I just noticed that the login designs have a "help finding connected email" button on the email screen so I've gone ahead and added it to the app, as well as fixed the error message by removing the part that no longer applies. Ready for a second round: |
|
@AmandaRiu, everything looks great!
Regarding this issue, I was able to reproduce it in emulators 26, 27 and 28. I'm not sure if this is because of my specific email/userId during login. In the above scenario, I enter the site address and redirected to the email screen. Once I select an email from the gmail list and enter the password, I am once again redirected to enter my WP username and password. FYI, the email address Once I enter my WP credentials though, I am able to login successfully to the dashboard. When I click on back from the dashboard screen, I once again, see the Log In screen. I shared my password for that email/username in Slack so you can reproduce the issue. I can also confirm that, as you mentioned, I am not able to reproduce this using another account. So maybe this might be a one off, with just my userId? If that is the case, I am ok to merge these changes 👍 Let me know what you think |
If not directly related to this PR, lets go ahead and merge it 👍 |
Error TypeErrorDangerfileError TypeErrorDangerfileGenerated by 🚫 dangerJS |
Error TypeErrorDangerfileError TypeErrorDangerfileGenerated by 🚫 dangerJS |





This PR partially addresses #1091 by adding the logic to check the site entered during the login flow for the following after successful account authentication:
If both of the above checks pass successfully, the login will complete and drop the user into the app without displaying the site selector.
Previous PRs for this feature:
Not included in this PR (coming later):
Site not connected to Account
If the site the user entered during login does not match the account the user logged in with, display a message advising of such. The user is presented with an option to Try another account.
Note: the site url is listed in the message instead of the site name because that information is not available until the user is authenticated with an account attached to the site.
If the authenticated account has active stores, the user is also given the option to view connected stores.
There is also a help option Need help finding the connected email? that will display an instructional dialog. The Need more help option will open the support page where the user can then submit a ticket.
Landscape: Landscape-specific screens are also included. While I was in the code I also fixed the problem with this page not scrolling.
Not a Woo Store
If the site the user entered during login does belong to the account the user logged in with, but does not have WooCommerce installed, display a message advising of such. Just like before, the user is presented Try another account, and, if stores exist for the active account, an option to View connected stores will also be displayed.
Has Woo and matches login
If the site the user entered during login does belong to the account the user logged in with AND has WooCommerce installed, we skip displaying any sites and automatically treat that store as if the user manually selected it.
How this works
LoginSiteAddressFragmentis stored inAppPrefs. I had to do this so it would be accessible even when the login process leaves the app as happens when a magic link is used for login. This pref key is get deleted upon successful store selection and verification.SitePickerActivityhas been modified to handle all of the above states. Originally I was going to try to handle all of this and skip the site picker until the user clicked on View connected sites, but I didn't want to duplicate all that logic in theMainActivity.Test Scenarios
Update release notes:
RELEASE-NOTES.txt.