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

Commit 55302d5

Browse files
authored
Merge pull request #247 from wordpress-mobile/merge-release-1.13-into-master
Release 1.13.0
2 parents 65d31b4 + 9e873b6 commit 55302d5

11 files changed

+75
-72
lines changed

Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def wordpress_authenticator_pods
1111
##
1212
pod 'Gridicons', '~> 1.0'
1313
pod 'WordPressUI', '~> 1.5.2'
14-
pod 'WordPressKit', '~> 4.7.0'
14+
pod 'WordPressKit', '~> 4.8.0'
1515
# pod 'WordPressKit', :git => 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', :branch => ''
1616
# pod 'WordPressKit', :git => 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', :commit => ''
1717
pod 'WordPressShared', '~> 1.8.16'

Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ PODS:
4444
- Specta (1.0.7)
4545
- SVProgressHUD (2.2.5)
4646
- UIDeviceIdentifier (1.4.0)
47-
- WordPressKit (4.7.0):
47+
- WordPressKit (4.8.0):
4848
- Alamofire (~> 4.8.0)
4949
- CocoaLumberjack (~> 3.4)
5050
- NSObject-SafeExpectations (= 0.0.4)
@@ -71,7 +71,7 @@ DEPENDENCIES:
7171
- OHHTTPStubs/Swift (= 8.0.0)
7272
- Specta (= 1.0.7)
7373
- SVProgressHUD (= 2.2.5)
74-
- WordPressKit (~> 4.7.0)
74+
- WordPressKit (~> 4.8.0)
7575
- WordPressShared (~> 1.8.16)
7676
- WordPressUI (~> 1.5.2)
7777

@@ -117,11 +117,11 @@ SPEC CHECKSUMS:
117117
Specta: 3e1bd89c3517421982dc4d1c992503e48bd5fe66
118118
SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6
119119
UIDeviceIdentifier: 44f805037d21b94394821828f4fcaba34b38c2d0
120-
WordPressKit: 0602e8188245b3267269570d3d78c138e64a4eba
120+
WordPressKit: 84045e236949248632a2c644149e5657733011bb
121121
WordPressShared: 1bc316ed162f42af4e0fa2869437e9e28b532b01
122122
WordPressUI: 70cc58a253c352330b23cd8fa6dd6a2021570e18
123123
wpxmlrpc: 6a9bdd6ab9d1b159b384b0df0f3f39de9af4fecf
124124

125-
PODFILE CHECKSUM: d2a5f1cb57eeb9eb2ac2cb22d29b6b827ccf8ce4
125+
PODFILE CHECKSUM: 8e0158473c1f3e6910b3b417c2f53fee11dc0bfc
126126

127127
COCOAPODS: 1.8.4

WordPressAuthenticator.podspec

Lines changed: 2 additions & 2 deletions
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.12.1"
3+
s.version = "1.13.0"
44
s.summary = "WordPressAuthenticator implements an easy and elegant way to authenticate your WordPress Apps."
55

66
s.description = <<-DESC
@@ -40,6 +40,6 @@ Pod::Spec.new do |s|
4040
s.dependency 'Gridicons', '~> 1.0'
4141
s.dependency 'GoogleSignIn', '~> 4.4'
4242
s.dependency 'WordPressUI', '~> 1.5.2'
43-
s.dependency 'WordPressKit', '~> 4.7.0'
43+
s.dependency 'WordPressKit', '~> 4.8.0'
4444
s.dependency 'WordPressShared', '~> 1.8.16'
4545
end

WordPressAuthenticator/Authenticator/WordPressAuthenticator.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,7 @@ import AuthenticationServices
198198
/// Returns an instance of LoginSiteAddressViewController: allows the user to log into a WordPress.org website.
199199
///
200200
@objc public class func signinForWPOrg() -> UIViewController {
201-
let storyboard = UIStoryboard(name: "Login", bundle: bundle)
202-
guard let controller = storyboard.instantiateViewController(withIdentifier: "siteAddress") as? LoginSiteAddressViewController else {
201+
guard let controller = LoginSiteAddressViewController.instantiate(from: .login) else {
203202
fatalError("unable to create wpcom password screen")
204203
}
205204

WordPressAuthenticator/NUX/NUXViewController.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ 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 showSigninV2
29-
case showURLUsernamePassword
3028
case showWPUsernamePassword
31-
case showSelfHostedLogin
3229
case showWPComLogin
3330
case startMagicLinkFlow
3431
case showMagicLink

WordPressAuthenticator/Signin/Login.storyboard

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="Ck1-vY-O11">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="Ck1-vY-O11">
33
<device id="retina4_7" orientation="portrait" appearance="light"/>
44
<dependencies>
55
<deployment identifier="iOS"/>
6-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16086"/>
77
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
88
</dependencies>
99
<scenes>
@@ -108,9 +108,7 @@
108108
</view>
109109
<navigationItem key="navigationItem" id="42E-2e-kOq"/>
110110
<connections>
111-
<segue destination="T5n-nb-cOW" kind="show" identifier="showSigninV2" id="nCA-u7-fKm"/>
112111
<segue destination="hed-vB-osh" kind="presentation" identifier="showLoginMethod" id="N3P-wt-Rn3"/>
113-
<segue destination="anK-hg-K4j" kind="show" identifier="showSelfHostedLogin" id="Njv-lY-Lyi"/>
114112
<segue destination="lmD-c6-SLs" kind="show" identifier="showWPComLogin" id="UV4-XI-c0q"/>
115113
</connections>
116114
</viewController>
@@ -350,28 +348,17 @@
350348
<outlet property="submitButton" destination="OZC-xf-OAn" id="k1c-SJ-qiK"/>
351349
<segue destination="Kvo-Y2-yhG" kind="show" identifier="startMagicLinkFlow" id="db9-5R-Qq7"/>
352350
<segue destination="lmD-c6-SLs" kind="show" identifier="showWPComLogin" id="ySQ-EM-6JI"/>
353-
<segue destination="anK-hg-K4j" kind="show" identifier="showSelfHostedLogin" id="bK1-J1-hfT"/>
354351
<segue destination="klu-4U-PyL" kind="show" identifier="showSignupEmail" id="dh4-9P-l8W"/>
355-
<segue destination="T5n-nb-cOW" kind="show" identifier="showSigninV2" id="sIC-Hv-FJw"/>
356-
<segue destination="SZS-o3-1P7" kind="show" identifier="showURLUsernamePassword" id="4SK-mG-U33"/>
357352
</connections>
358353
</viewController>
359354
<placeholder placeholderIdentifier="IBFirstResponder" id="wWl-qb-1Yp" userLabel="First Responder" sceneMemberID="firstResponder"/>
360355
</objects>
361356
<point key="canvasLocation" x="1674" y="188"/>
362357
</scene>
363-
<!--SignupEmailViewController-->
364-
<scene sceneID="CQL-qu-sjW">
365-
<objects>
366-
<viewControllerPlaceholder storyboardName="Signup" referencedIdentifier="SignupEmailViewController" id="T5n-nb-cOW" sceneMemberID="viewController"/>
367-
<placeholder placeholderIdentifier="IBFirstResponder" id="UdV-y0-6AN" userLabel="First Responder" sceneMemberID="firstResponder"/>
368-
</objects>
369-
<point key="canvasLocation" x="-530" y="760"/>
370-
</scene>
371358
<!--Login Self Hosted View Controller-->
372359
<scene sceneID="b2O-iW-wfB">
373360
<objects>
374-
<viewController storyboardIdentifier="selfHosted" useStoryboardIdentifierAsRestorationIdentifier="YES" id="SZS-o3-1P7" customClass="LoginSelfHostedViewController" customModule="WordPressAuthenticator" sceneMemberID="viewController">
361+
<viewController storyboardIdentifier="LoginSelfHostedViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="SZS-o3-1P7" customClass="LoginSelfHostedViewController" customModule="WordPressAuthenticator" sceneMemberID="viewController">
375362
<layoutGuides>
376363
<viewControllerLayoutGuide type="top" id="Yjk-Cc-Bxb"/>
377364
<viewControllerLayoutGuide type="bottom" id="Ktl-It-Kmo"/>
@@ -1013,7 +1000,7 @@
10131000
<!--Login Site Address View Controller-->
10141001
<scene sceneID="idG-jg-gxH">
10151002
<objects>
1016-
<viewController storyboardIdentifier="siteAddress" extendedLayoutIncludesOpaqueBars="YES" useStoryboardIdentifierAsRestorationIdentifier="YES" id="anK-hg-K4j" customClass="LoginSiteAddressViewController" customModule="WordPressAuthenticator" sceneMemberID="viewController">
1003+
<viewController storyboardIdentifier="LoginSiteAddressViewController" extendedLayoutIncludesOpaqueBars="YES" useStoryboardIdentifierAsRestorationIdentifier="YES" id="anK-hg-K4j" customClass="LoginSiteAddressViewController" customModule="WordPressAuthenticator" sceneMemberID="viewController">
10171004
<layoutGuides>
10181005
<viewControllerLayoutGuide type="top" id="pmp-Uj-4NW"/>
10191006
<viewControllerLayoutGuide type="bottom" id="rYV-q2-blN"/>
@@ -1155,7 +1142,6 @@
11551142
<outlet property="siteAddressHelpButton" destination="roL-ID-k8n" id="QB2-ri-X5V"/>
11561143
<outlet property="siteURLField" destination="ZrT-CY-qD7" id="561-Zw-Ja9"/>
11571144
<outlet property="submitButton" destination="ltO-hW-mbe" id="wwr-D5-5kK"/>
1158-
<segue destination="SZS-o3-1P7" kind="show" identifier="showURLUsernamePassword" id="TkG-0R-c3i"/>
11591145
<segue destination="iMi-vX-AxR" kind="show" identifier="showWPUsernamePassword" id="dtm-iK-PLb"/>
11601146
<segue destination="hed-vB-osh" kind="presentation" identifier="showLoginMethod" id="5hL-j3-eMs"/>
11611147
<segue destination="lmD-c6-SLs" kind="show" identifier="showWPComLogin" id="8p6-rS-9Ml"/>
@@ -1435,17 +1421,14 @@
14351421
<point key="canvasLocation" x="-460" y="1248"/>
14361422
</scene>
14371423
</scenes>
1438-
<resources>
1439-
<image name="icon-password-field" width="18" height="22"/>
1440-
<image name="icon-url-field" width="18" height="22"/>
1441-
<image name="icon-username-field" width="18" height="18"/>
1442-
</resources>
14431424
<inferredMetricsTieBreakers>
14441425
<segue reference="N3P-wt-Rn3"/>
1445-
<segue reference="Njv-lY-Lyi"/>
14461426
<segue reference="UV4-XI-c0q"/>
1447-
<segue reference="4SK-mG-U33"/>
1448-
<segue reference="sIC-Hv-FJw"/>
14491427
<segue reference="iD4-VS-n3M"/>
14501428
</inferredMetricsTieBreakers>
1429+
<resources>
1430+
<image name="icon-password-field" width="18" height="22"/>
1431+
<image name="icon-url-field" width="18" height="22"/>
1432+
<image name="icon-username-field" width="18" height="18"/>
1433+
</resources>
14511434
</document>

WordPressAuthenticator/Signin/LoginEmailViewController.swift

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,14 @@ open class LoginEmailViewController: LoginViewController, NUXKeyboardResponder {
205205

206206
// Don't forget to handle the button taps!
207207
vc.emailTapped = { [weak self] in
208-
self?.performSegue(withIdentifier: .showSigninV2, sender: self)
208+
guard let toVC = SignupEmailViewController.instantiate(from: .signup) else {
209+
DDLogError("Failed to navigate from LoginEmailViewController to SignupEmailViewController")
210+
return
211+
}
212+
213+
self?.navigationController?.pushViewController(toVC, animated: true)
209214
}
215+
210216
vc.googleTapped = { [weak self] in
211217
guard let toVC = SignupGoogleViewController.instantiate(from: .signup) else {
212218
DDLogError("Failed to navigate to SignupGoogleViewController")
@@ -215,6 +221,7 @@ open class LoginEmailViewController: LoginViewController, NUXKeyboardResponder {
215221

216222
self?.navigationController?.pushViewController(toVC, animated: true)
217223
}
224+
218225
vc.appleTapped = { [weak self] in
219226
self?.appleTapped()
220227
}
@@ -396,13 +403,24 @@ open class LoginEmailViewController: LoginViewController, NUXKeyboardResponder {
396403
}
397404

398405
/// Configures loginFields to log into wordpress.com and
399-
/// navigates to the selfhosted username/password form. Displays the specified
400-
/// error message when the new view controller appears.
406+
/// navigates to the selfhosted username/password form.
407+
/// Displays the specified error message when the new
408+
/// view controller appears.
401409
///
402410
@objc func showSelfHostedUsernamePasswordAndError(_ error: Error) {
403411
loginFields.siteAddress = "https://wordpress.com"
404412
errorToPresent = error
405-
performSegue(withIdentifier: .showURLUsernamePassword, sender: self)
413+
414+
guard let vc = LoginSelfHostedViewController.instantiate(from: .login) else {
415+
DDLogError("Failed to navigate from LoginEmailViewController to LoginSelfHostedViewController")
416+
return
417+
}
418+
419+
vc.loginFields = loginFields
420+
vc.dismissBlock = dismissBlock
421+
vc.errorToPresent = errorToPresent
422+
423+
navigationController?.pushViewController(vc, animated: true)
406424
}
407425

408426
override open func displayRemoteError(_ error: Error) {
@@ -417,29 +435,6 @@ open class LoginEmailViewController: LoginViewController, NUXKeyboardResponder {
417435
return EmailFormatValidator.validate(string: loginFields.username)
418436
}
419437

420-
421-
// MARK: - Segue
422-
423-
override open func prepare(for segue: UIStoryboardSegue, sender: Any?) {
424-
super.prepare(for: segue, sender: sender)
425-
426-
if let vc = segue.destination as? LoginPrologueSignupMethodViewController {
427-
vc.transitioningDelegate = self
428-
vc.emailTapped = { [weak self] in
429-
self?.performSegue(withIdentifier: .showSigninV2, sender: self)
430-
}
431-
vc.googleTapped = { [weak self] in
432-
guard let toVC = SignupGoogleViewController.instantiate(from: .signup) else {
433-
DDLogError("Failed to navigate to SignupGoogleViewController")
434-
return
435-
}
436-
437-
self?.navigationController?.pushViewController(toVC, animated: true)
438-
}
439-
vc.modalPresentationStyle = .custom
440-
}
441-
}
442-
443438
// MARK: - Actions
444439

445440

@@ -536,7 +531,9 @@ open class LoginEmailViewController: LoginViewController, NUXKeyboardResponder {
536531

537532
// MARK: - Google Sign In
538533

539-
// LoginFacadeDelegate methods for Google Google Sign In
534+
/// Make Google Sign In conform to the LoginFacade protocol.
535+
/// The delegate calls these methods from LoginFacade.m.
536+
///
540537
extension LoginEmailViewController {
541538
func finishedLogin(withGoogleIDToken googleIDToken: String, authToken: String) {
542539
googleFinishedLogin(withGoogleIDToken: googleIDToken, authToken: authToken)
@@ -547,6 +544,9 @@ extension LoginEmailViewController {
547544
googleExistingUserNeedsConnection(email)
548545
}
549546

547+
/// After a successful Google Sign In, this method gets called when the user
548+
/// has enabled 2-factor authentication for their WordPress.com account.
549+
///
550550
func needsMultifactorCode(forUserID userID: Int, andNonceInfo nonceInfo: SocialLogin2FANonceInfo) {
551551
configureViewLoading(false)
552552
socialNeedsMultifactorCode(forUserID: userID, andNonceInfo: nonceInfo)

WordPressAuthenticator/Signin/LoginPrologueViewController.swift

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ class LoginPrologueViewController: LoginViewController {
7878
let loginTitle = NSLocalizedString("Log In", comment: "Button title. Tapping takes the user to the login form.")
7979
let createTitle = NSLocalizedString("Sign up for WordPress.com", comment: "Button title. Tapping begins the process of creating a WordPress.com account.")
8080

81-
buttonViewController.setupTopButton(title: loginTitle, isPrimary: true, accessibilityIdentifier: "Prologue Log In Button") { [weak self] in
81+
buttonViewController.setupTopButton(title: loginTitle, isPrimary: false, accessibilityIdentifier: "Prologue Log In Button") { [weak self] in
8282
self?.loginTapped()
8383
}
84-
buttonViewController.setupBottomButton(title: createTitle, isPrimary: false, accessibilityIdentifier: "Prologue Signup Button") { [weak self] in
84+
buttonViewController.setupBottomButton(title: createTitle, isPrimary: true, accessibilityIdentifier: "Prologue Signup Button") { [weak self] in
8585
self?.signupTapped()
8686
}
8787
if showCancel {
@@ -124,7 +124,12 @@ class LoginPrologueViewController: LoginViewController {
124124
vc.modalPresentationStyle = .custom
125125

126126
vc.emailTapped = { [weak self] in
127-
self?.performSegue(withIdentifier: .showSigninV2, sender: self)
127+
guard let toVC = SignupEmailViewController.instantiate(from: .signup) else {
128+
DDLogError("Failed to navigate to SignupEmailViewController")
129+
return
130+
}
131+
132+
self?.navigationController?.pushViewController(toVC, animated: true)
128133
}
129134

130135
vc.googleTapped = { [weak self] in

WordPressAuthenticator/Signin/LoginSiteAddressViewController.swift

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,16 @@ class LoginSiteAddressViewController: LoginViewController, NUXKeyboardResponder
258258
///
259259
@objc func showSelfHostedUsernamePassword() {
260260
configureViewLoading(false)
261-
performSegue(withIdentifier: .showURLUsernamePassword, sender: self)
261+
guard let vc = LoginSelfHostedViewController.instantiate(from: .login) else {
262+
DDLogError("Failed to navigate from LoginEmailViewController to LoginSelfHostedViewController")
263+
return
264+
}
265+
266+
vc.loginFields = loginFields
267+
vc.dismissBlock = dismissBlock
268+
vc.errorToPresent = errorToPresent
269+
270+
navigationController?.pushViewController(vc, animated: true)
262271
}
263272

264273
/// Break away from the self-hosted flow.

WordPressAuthenticator/Signin/LoginViewController.swift

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,18 @@ open class LoginViewController: NUXViewController, LoginFacadeDelegate {
136136
}
137137

138138
/// Displays the self-hosted sign in form.
139+
///
139140
func loginToSelfHostedSite() {
140-
performSegue(withIdentifier: .showSelfHostedLogin, sender: self)
141+
guard let vc = LoginSiteAddressViewController.instantiate(from: .login) else {
142+
DDLogError("Failed to navigate from LoginViewController to LoginSiteAddressViewController")
143+
return
144+
}
145+
146+
vc.loginFields = loginFields
147+
vc.dismissBlock = dismissBlock
148+
vc.errorToPresent = errorToPresent
149+
150+
navigationController?.pushViewController(vc, animated: true)
141151
}
142152

143153
/// Validates what is entered in the various form fields and, if valid,

0 commit comments

Comments
 (0)