-
Notifications
You must be signed in to change notification settings - Fork 11
Fix Google 2FA login #157
Fix Google 2FA login #157
Conversation
…ign in flow. Previously, it was using the Google *sign up* flow, which doesn't handle the 2FA case.
|
@jaclync or @pmusolino - Can I bother you to test these changes in Woo? Specifically, the |
Thanks for creating the branch on WCiOS! I tested on |
|
Thanks @jaclync ! |
frosty
left a comment
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.
Just a couple of comments to go along with my review of the WPiOS PR. Nothing major!
| errorToPresent = error | ||
| performSegue(withIdentifier: .showWPComLogin, sender: self) | ||
| } | ||
| displayRemoteErrorForGoogle(error) |
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.
Is the error displayed here always a Google error? There was previously a check for if awaitingGoogle... else – was the else case for non-Google errors?
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.
Oh, I see that the new method includes the else statement!
| } | ||
|
|
||
| extension LoginPrologueViewController: GIDSignInDelegate { | ||
| open func sign(_ signIn: GIDSignIn?, didSignInFor user: GIDGoogleUser?, withError error: Error?) { |
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.
should we name this signIn, instead of sign?
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 method belongs to GIDSignInDelegate (the Google delegate), so... no. 😄 .
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.
omg sorry 🙃 :homer-disappear:
Ref WPiOS issue: wordpress-mobile/WordPress-iOS#13004
Can be tested with WPiOS PR: wordpress-mobile/WordPress-iOS#13005
Woo test branch:
try/google_loginThis fixes the path where a user tries to login in with a Google account that has 2FA enabled on the WordPress account.
Previously, it was using the Google sign up flow, which was incorrect (and doesn't handle 2FA accounts).
This moves the Google sign in logic into
LoginViewControllerso it can be accessed viaLoginEmailViewController(flow used by Woo) andLoginPrologueViewController(flow used by WPiOS).