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

ULS: Unify Google auth flows #295

Merged
merged 6 commits into from
Jun 3, 2020
Merged

Conversation

ScoutHarris
Copy link
Contributor

@ScoutHarris ScoutHarris commented Jun 2, 2020

Ref: #282
Can be tested with WPiOS PR: wordpress-mobile/WordPress-iOS#14235

To accommodate unified Google auth flow:

  • There is now a GoogleAuthenticatorDelegate that encompasses all delegate methods needed for the unified flow.
    • This is only used by GoogleAuthViewController (the VC for the unified flow).
    • GoogleAuthenticatorLoginDelegate and GoogleAuthenticatorSignupDelegate remain to support the old separate flows (LoginPrologueViewController, LoginEmailViewController, SignupGoogleViewController) .
  • Bonus: The Processing Account HUD is now shown in the login flow (previously it was only shown in signup).

With this change, the Google flows are unified. Since GoogleAuthViewController is presented from both login and signup, they both use the same flow. 🎉

There is one path that is not unified yet.

After a Google account is selected, GoogleAuthenticator will first attempt to login. If a WP account does not exist, it does not redirect to signup as there is no logic currently to do so. (That's the point of this project after all, innit? 😄 ) Instead, this view is displayed. This will be addressed in a future PR. Stay tuned!

login_with_new_acct

@ScoutHarris ScoutHarris self-assigned this Jun 2, 2020
@ScoutHarris ScoutHarris marked this pull request as ready for review June 2, 2020 21:53
@ScoutHarris ScoutHarris mentioned this pull request Jun 2, 2020
16 tasks
Copy link
Contributor

@mindgraffiti mindgraffiti left a comment

Choose a reason for hiding this comment

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

With this change, the Google flows are unified.

They got married! 💍

✅ verified Processing Account appears in the HUD
✅ code

:shipit:

@ScoutHarris ScoutHarris merged commit 64cf51f into develop Jun 3, 2020
@ScoutHarris ScoutHarris deleted the feature/282-google_unified_flows branch June 3, 2020 17:05
@@ -47,6 +84,7 @@ class GoogleAuthenticator: NSObject {
private override init() {}
var loginDelegate: GoogleAuthenticatorLoginDelegate?
var signupDelegate: GoogleAuthenticatorSignupDelegate?
var delegate: GoogleAuthenticatorDelegate?
Copy link
Contributor

Choose a reason for hiding this comment

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

This property should be weak (and the related protocol, class bound), otherwise it looks like an instance of GoogleAuthViewController is retained after the login completes. Here's a screenshot of the memory graph showing that.

Screen Shot 2020-06-03 at 12 04 41 PM

Note that when I tweaked that var to weak, this did not happen. It maybe worth looking in the two existing delegates as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Dang it! I always forget to make them weak. Thanks @Gio2018 ! I'll address that in my next PR!

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

Successfully merging this pull request may close these issues.

3 participants