Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Commit 7c72bba

Browse files
authored
Merge pull request #245 from wordpress-mobile/issue/244-remove-showWPUsernamePassword
UL&S: Remove .showWPUsernamePassword
2 parents 949b8ba + e3459d0 commit 7c72bba

File tree

4 files changed

+27
-10
lines changed

4 files changed

+27
-10
lines changed

WordPressAuthenticator.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "WordPressAuthenticator"
3-
s.version = "1.13.0"
3+
s.version = "1.14.0-beta.1"
44
s.summary = "WordPressAuthenticator implements an easy and elegant way to authenticate your WordPress Apps."
55

66
s.description = <<-DESC

WordPressAuthenticator/NUX/NUXViewController.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ open class NUXViewController: UIViewController, NUXViewControllerBase, UIViewCon
2525
// MARK: associated type for NUXSegueHandler
2626
/// Segue identifiers to avoid using strings
2727
public enum SegueIdentifier: String {
28-
case showWPUsernamePassword
2928
case showWPComLogin
3029
case startMagicLinkFlow
3130
case showMagicLink

WordPressAuthenticator/Signin/Login.storyboard

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<device id="retina4_7" orientation="portrait" appearance="light"/>
44
<dependencies>
55
<deployment identifier="iOS"/>
6-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16086"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
77
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
88
</dependencies>
99
<scenes>
@@ -1142,7 +1142,6 @@
11421142
<outlet property="siteAddressHelpButton" destination="roL-ID-k8n" id="QB2-ri-X5V"/>
11431143
<outlet property="siteURLField" destination="ZrT-CY-qD7" id="561-Zw-Ja9"/>
11441144
<outlet property="submitButton" destination="ltO-hW-mbe" id="wwr-D5-5kK"/>
1145-
<segue destination="iMi-vX-AxR" kind="show" identifier="showWPUsernamePassword" id="dtm-iK-PLb"/>
11461145
<segue destination="hed-vB-osh" kind="presentation" identifier="showLoginMethod" id="5hL-j3-eMs"/>
11471146
<segue destination="lmD-c6-SLs" kind="show" identifier="showWPComLogin" id="8p6-rS-9Ml"/>
11481147
</connections>
@@ -1154,7 +1153,7 @@
11541153
<!--Login Username Password View Controller-->
11551154
<scene sceneID="b9v-Sc-w6J">
11561155
<objects>
1157-
<viewController storyboardIdentifier="wpUsernamePassword" useStoryboardIdentifierAsRestorationIdentifier="YES" id="iMi-vX-AxR" customClass="LoginUsernamePasswordViewController" customModule="WordPressAuthenticator" sceneMemberID="viewController">
1156+
<viewController storyboardIdentifier="LoginUsernamePasswordViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="iMi-vX-AxR" customClass="LoginUsernamePasswordViewController" customModule="WordPressAuthenticator" sceneMemberID="viewController">
11581157
<layoutGuides>
11591158
<viewControllerLayoutGuide type="top" id="De3-R2-Sm2"/>
11601159
<viewControllerLayoutGuide type="bottom" id="NPl-SI-4X2"/>
@@ -1422,9 +1421,9 @@
14221421
</scene>
14231422
</scenes>
14241423
<inferredMetricsTieBreakers>
1425-
<segue reference="N3P-wt-Rn3"/>
1426-
<segue reference="UV4-XI-c0q"/>
1427-
<segue reference="iD4-VS-n3M"/>
1424+
<segue reference="5hL-j3-eMs"/>
1425+
<segue reference="8p6-rS-9Ml"/>
1426+
<segue reference="JN3-Ck-2w7"/>
14281427
</inferredMetricsTieBreakers>
14291428
<resources>
14301429
<image name="icon-password-field" width="18" height="22"/>

WordPressAuthenticator/Signin/LoginSiteAddressViewController.swift

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,17 @@ class LoginSiteAddressViewController: LoginViewController, NUXKeyboardResponder
275275
///
276276
@objc func showWPUsernamePassword() {
277277
configureViewLoading(false)
278-
performSegue(withIdentifier: .showWPUsernamePassword, sender: self)
278+
279+
guard let vc = LoginUsernamePasswordViewController.instantiate(from: .login) else {
280+
DDLogError("Failed to navigate from LoginSiteAddressViewController to LoginUsernamePasswordViewController")
281+
return
282+
}
283+
284+
vc.loginFields = loginFields
285+
vc.dismissBlock = dismissBlock
286+
vc.errorToPresent = errorToPresent
287+
288+
navigationController?.pushViewController(vc, animated: true)
279289
}
280290

281291
/// Break away from the self-hosted flow.
@@ -286,15 +296,22 @@ class LoginSiteAddressViewController: LoginViewController, NUXKeyboardResponder
286296
performSegue(withIdentifier: .showLoginMethod, sender: self)
287297
}
288298

299+
/// Ref. https://git.io/JfJ4s - settings for Woo.
300+
/// After a site address has been validated,
301+
/// display the 3 button view login options.
302+
///
289303
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
290304
super.prepare(for: segue, sender: sender)
291305

292306
if let vc = segue.destination as? LoginPrologueLoginMethodViewController {
293307
vc.transitioningDelegate = self
294-
308+
309+
// Continue with WordPress.com button action
295310
vc.emailTapped = { [weak self] in
296311
self?.showWPUsernamePassword()
297312
}
313+
314+
// Continue with Google button action
298315
vc.googleTapped = { [weak self] in
299316
guard let toVC = SignupGoogleViewController.instantiate(from: .signup) else {
300317
DDLogError("Failed to navigate to SignupGoogleViewController")
@@ -303,6 +320,8 @@ class LoginSiteAddressViewController: LoginViewController, NUXKeyboardResponder
303320

304321
self?.navigationController?.pushViewController(toVC, animated: true)
305322
}
323+
324+
// Sign In With Apple (SIWA) button action
306325
vc.appleTapped = { [weak self] in
307326
self?.appleTapped()
308327
}

0 commit comments

Comments
 (0)