-
Notifications
You must be signed in to change notification settings - Fork 11
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
Conversation
Also, show HUD for login flow as well as signup.
There was a problem hiding this 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
@@ -47,6 +84,7 @@ class GoogleAuthenticator: NSObject { | |||
private override init() {} | |||
var loginDelegate: GoogleAuthenticatorLoginDelegate? | |||
var signupDelegate: GoogleAuthenticatorSignupDelegate? | |||
var delegate: GoogleAuthenticatorDelegate? |
There was a problem hiding this comment.
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.
Note that when I tweaked that var to weak, this did not happen. It maybe worth looking in the two existing delegates as well
There was a problem hiding this comment.
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!
Ref: #282
Can be tested with WPiOS PR: wordpress-mobile/WordPress-iOS#14235
To accommodate unified Google auth flow:
GoogleAuthenticatorDelegate
that encompasses all delegate methods needed for the unified flow.GoogleAuthViewController
(the VC for the unified flow).GoogleAuthenticatorLoginDelegate
andGoogleAuthenticatorSignupDelegate
remain to support the old separate flows (LoginPrologueViewController
,LoginEmailViewController
,SignupGoogleViewController
) .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!