This repository was archived by the owner on Feb 5, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
WordPressAuthenticator/Unified Auth/View Related Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ public enum SignInSource {
1313/// The error during the sign in flow.
1414public enum SignInError : Error {
1515 case invalidWPComEmail( source: SignInSource )
16+ case invalidWPComPassword( source: SignInSource )
1617
1718 init ? ( error: Error , source: SignInSource ? ) {
1819 let error = error as NSError
@@ -520,6 +521,7 @@ private extension GetStartedViewController {
520521 return
521522 }
522523
524+ vc. source = source
523525 vc. loginFields = loginFields
524526 vc. trackAsPasswordChallenge = false
525527
Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ class PasswordViewController: LoginViewController {
2121 ///
2222 var trackAsPasswordChallenge = true
2323
24+ var source : SignInSource ?
25+
2426 override var loginFields : LoginFields {
2527 didSet {
2628 loginFields. password = " "
@@ -121,6 +123,15 @@ class PasswordViewController: LoginViewController {
121123 let errorCode = nsError. code
122124 let errorDomain = nsError. domain
123125
126+ if let source = source, loginFields. meta. userIsDotCom {
127+ let passwordError = SignInError . invalidWPComPassword ( source: source)
128+ if authenticationDelegate. shouldHandleError ( passwordError) {
129+ authenticationDelegate. handleError ( passwordError) { [ weak self] _ in
130+ // No custom navigation is expected in this case.
131+ }
132+ }
133+ }
134+
124135 if errorDomain == WordPressComOAuthClient . WordPressComOAuthErrorDomain,
125136 errorCode == WordPressComOAuthError . invalidRequest. rawValue {
126137
You can’t perform that action at this time.
0 commit comments