Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ workflows:
jobs:
- ios/test:
name: Test
xcode-version: "11.0"
xcode-version: "11.2.1"
workspace: WordPressAuthenticator.xcworkspace
scheme: WordPressAuthenticator
device: iPhone 11
ios-version: "13.0"
ios-version: "13.2.2"
bundle-install: true
pod-install: true
- ios/validate-podspec:
name: Validate Podspec
xcode-version: "11.0"
xcode-version: "11.2.1"
podspec-path: WordPressAuthenticator.podspec
bundle-install: true
- ios/publish-podspec:
name: Publish to Trunk
xcode-version: "11.0"
xcode-version: "11.2.1"
podspec-path: WordPressAuthenticator.podspec
bundle-install: true
post-to-slack: true
Expand Down
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.5.5
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def wordpress_authenticator_pods
##
pod 'Gridicons', '~> 0.15'
pod 'WordPressUI', '~> 1.4-beta.1'
pod 'WordPressKit', '~> 4.5.4'
pod 'WordPressKit', '~> 4.5.5'
# pod 'WordPressKit', :git => 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', :branch => 'issue/apple_2fa_auth'
pod 'WordPressShared', '~> 1.8'

Expand Down
8 changes: 4 additions & 4 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ PODS:
- Specta (1.0.7)
- SVProgressHUD (2.2.5)
- UIDeviceIdentifier (1.4.0)
- WordPressKit (4.5.4):
- WordPressKit (4.5.5):
- Alamofire (~> 4.7.3)
- CocoaLumberjack (~> 3.4)
- NSObject-SafeExpectations (= 0.0.3)
Expand All @@ -71,7 +71,7 @@ DEPENDENCIES:
- OHHTTPStubs/Swift (= 8.0.0)
- Specta (= 1.0.7)
- SVProgressHUD (= 2.2.5)
- WordPressKit (~> 4.5.4)
- WordPressKit (~> 4.5.5)
- WordPressShared (~> 1.8)
- WordPressUI (~> 1.4-beta.1)

Expand Down Expand Up @@ -117,11 +117,11 @@ SPEC CHECKSUMS:
Specta: 3e1bd89c3517421982dc4d1c992503e48bd5fe66
SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6
UIDeviceIdentifier: 44f805037d21b94394821828f4fcaba34b38c2d0
WordPressKit: 1d365775fac17903a76ad5723bc146ab1739ec82
WordPressKit: 8029cb93a89de79442254c346523da11c2706d7b
WordPressShared: 09cf184caa614835f5811e8609227165201e6d3e
WordPressUI: 35b144885c8e5817ba6874b68accc200bda61ee1
wpxmlrpc: 6ba55c773cfa27083ae4a2173e69b19f46da98e2

PODFILE CHECKSUM: 6f930e58860031b74be490800e49e91a4f3cd75f
PODFILE CHECKSUM: e4f5f036a95bf5e1df937bfa7d2d24b4ee5bbb18

COCOAPODS: 1.8.4
4 changes: 2 additions & 2 deletions WordPressAuthenticator.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "WordPressAuthenticator"
s.version = "1.10.4"
s.version = "1.10.5"
s.summary = "WordPressAuthenticator implements an easy and elegant way to authenticate your WordPress Apps."

s.description = <<-DESC
Expand Down Expand Up @@ -39,6 +39,6 @@ Pod::Spec.new do |s|
s.dependency 'Gridicons', '~> 0.15'
s.dependency 'GoogleSignIn', '~> 4.4'
s.dependency 'WordPressUI', '~> 1.4-beta.1'
s.dependency 'WordPressKit', '~> 4.5.4'
s.dependency 'WordPressKit', '~> 4.5.5'
s.dependency 'WordPressShared', '~> 1.8'
end
7 changes: 7 additions & 0 deletions WordPressAuthenticator/Extensions/WPStyleGuide+Login.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ extension WPStyleGuide {
onePasswordButton.addTarget(target, action: selector, for: .touchUpInside)
}

/// Configures a plain text button with default styles.
///
class func configureTextButton(_ button: UIButton) {
button.setTitleColor(WordPressAuthenticator.shared.style.textButtonColor, for: .normal)
button.setTitleColor(WordPressAuthenticator.shared.style.textButtonHighlightColor, for: .highlighted)
}

///
///
class func colorForErrorView(_ opaque: Bool) -> UIColor {
Expand Down
6 changes: 4 additions & 2 deletions WordPressAuthenticator/Logging/WPAuthenticatorLogging.h
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
int WPAuthenticatorGetLoggingLevel(void);
void WPAuthenticatorSetLoggingLevel(int level);
@import CocoaLumberjack;

DDLogLevel WPAuthenticatorGetLoggingLevel(void);
void WPAuthenticatorSetLoggingLevel(DDLogLevel level);
4 changes: 2 additions & 2 deletions WordPressAuthenticator/Logging/WPAuthenticatorLogging.m
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#import "WPAuthenticatorLogging.h"
#import "WPAuthenticatorLoggingPrivate.h"

int WPAuthenticatorGetLoggingLevel() {
DDLogLevel WPAuthenticatorGetLoggingLevel() {
return ddLogLevel;
}

void WPAuthenticatorSetLoggingLevel(int level) {
void WPAuthenticatorSetLoggingLevel(DDLogLevel level) {
ddLogLevel = level;
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@import CocoaLumberjack;
extern int ddLogLevel;
extern DDLogLevel ddLogLevel;
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#import "WPAuthenticatorLoggingPrivate.h"
int ddLogLevel = DDLogLevelWarning;
DDLogLevel ddLogLevel = DDLogLevelWarning;
4 changes: 4 additions & 0 deletions WordPressAuthenticator/Signin/Login.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
</constraints>
</view>
<connections>
<outlet property="dismissButton" destination="gpM-nW-lFQ" id="8iA-TH-TF4"/>
<segue destination="fwZ-QE-5et" kind="show" identifier="showEmailLogin" id="1xT-tL-sp6"/>
</connections>
</viewController>
Expand Down Expand Up @@ -1450,6 +1451,9 @@
<constraint firstAttribute="trailing" secondItem="Ueg-Bw-KU6" secondAttribute="trailing" id="nXh-Tu-veg"/>
</constraints>
</view>
<connections>
<outlet property="dismissButton" destination="Ueg-Bw-KU6" id="icp-fM-bz4"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Rrd-X3-roK" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
Expand Down
2 changes: 2 additions & 0 deletions WordPressAuthenticator/Signin/Login2FAViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class Login2FAViewController: LoginViewController, NUXKeyboardResponder, UITextF
super.viewWillAppear(animated)

configureViewForEditingIfNeeded()
styleSendCodeButton()
}


Expand Down Expand Up @@ -78,6 +79,7 @@ class Login2FAViewController: LoginViewController, NUXKeyboardResponder, UITextF
private func styleSendCodeButton() {
sendCodeButton.titleLabel?.adjustsFontForContentSizeCategory = true
sendCodeButton.titleLabel?.adjustsFontSizeToFitWidth = true
WPStyleGuide.configureTextButton(sendCodeButton)
}

// MARK: Configuration Methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ open class LoginEmailViewController: LoginViewController, NUXKeyboardResponder {
loginFields.meta.userIsDotCom = true

configureEmailField()
configureAlternativeLabel()
configureSubmitButton()
configureViewForEditingIfNeeded()
configureForWPComOnlyIfNeeded()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class LoginLinkRequestViewController: LoginViewController {
super.viewDidLoad()

localizeControls()
configureUsePasswordButton()

let email = loginFields.username
if !email.isValidEmail() {
Expand Down Expand Up @@ -78,6 +79,13 @@ class LoginLinkRequestViewController: LoginViewController {
sendLinkButton?.isEnabled = !animating
}

private func configureUsePasswordButton() {
guard let usePasswordButton = usePasswordButton else {
return
}
WPStyleGuide.configureTextButton(usePasswordButton)
}


// MARK: - Instance Methods

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ class LoginPrologueLoginMethodViewController: NUXViewController {
open var selfHostedTapped: (() -> Void)?
open var appleTapped: (() -> Void)?

/// The big transparent (dismiss) button behind the buttons
@IBOutlet private weak var dismissButton: UIButton!

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
super.prepare(for: segue, sender: sender)

Expand All @@ -24,6 +27,7 @@ class LoginPrologueLoginMethodViewController: NUXViewController {
override func viewDidLoad() {
super.viewDidLoad()
configureButtonVC()
configureForAccessibility()
}

override func viewWillAppear(_ animated: Bool) {
Expand Down Expand Up @@ -85,4 +89,23 @@ class LoginPrologueLoginMethodViewController: NUXViewController {
appleTapped?()
}

// MARK: - Accessibility

private func configureForAccessibility() {
dismissButton.accessibilityLabel = NSLocalizedString("Dismiss", comment: "Accessibility label for the transparent space above the login dialog which acts as a button to dismiss the dialog.")

// Ensure that the first button (in buttonViewController) is automatically selected by
// VoiceOver instead of the dismiss button.
if buttonViewController?.isViewLoaded == true, let buttonsView = buttonViewController?.view {
view.accessibilityElements = [
buttonsView,
dismissButton
]
}
}

override func accessibilityPerformEscape() -> Bool {
dismiss(animated: true)
return true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ class LoginPrologueSignupMethodViewController: NUXViewController {
open var googleTapped: (() -> Void)?
open var appleTapped: (() -> Void)?

/// The big transparent (dismiss) button behind the buttons
@IBOutlet private weak var dismissButton: UIButton!

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
super.prepare(for: segue, sender: sender)

Expand All @@ -25,6 +28,7 @@ class LoginPrologueSignupMethodViewController: NUXViewController {
override func viewDidLoad() {
super.viewDidLoad()
configureButtonVC()
configureForAccessibility()
}

override func viewWillAppear(_ animated: Bool) {
Expand Down Expand Up @@ -82,8 +86,7 @@ class LoginPrologueSignupMethodViewController: NUXViewController {
}

@IBAction func dismissTapped() {
WordPressAuthenticator.track(.signupCancelled)
dismiss(animated: true)
trackCancellationAndThenDismiss()
}

@objc func handleAppleButtonTapped() {
Expand All @@ -92,4 +95,29 @@ class LoginPrologueSignupMethodViewController: NUXViewController {
dismiss(animated: true)
appleTapped?()
}

private func trackCancellationAndThenDismiss() {
WordPressAuthenticator.track(.signupCancelled)
dismiss(animated: true)
}

// MARK: - Accessibility

private func configureForAccessibility() {
dismissButton.accessibilityLabel = NSLocalizedString("Dismiss", comment: "Accessibility label for the transparent space above the signup dialog which acts as a button to dismiss the dialog.")

// Ensure that the first button (in buttonViewController) is automatically selected by
// VoiceOver instead of the dismiss button.
if buttonViewController?.isViewLoaded == true, let buttonsView = buttonViewController?.view {
view.accessibilityElements = [
buttonsView,
dismissButton
]
}
}

override func accessibilityPerformEscape() -> Bool {
trackCancellationAndThenDismiss()
return true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class LoginSelfHostedViewController: LoginViewController, NUXKeyboardResponder {
///
@objc func configureForgotPasswordButton() {
forgotPasswordButton.isEnabled = enableSubmit(animating: false)
WPStyleGuide.configureTextButton(forgotPasswordButton)
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class LoginSiteAddressViewController: LoginViewController, NUXKeyboardResponder
loginFields.meta.userIsDotCom = false

configureTextFields()
configureSiteAddressHelpButton()
configureSubmitButton(animating: false)
configureViewForEditingIfNeeded()

Expand Down Expand Up @@ -132,6 +133,10 @@ class LoginSiteAddressViewController: LoginViewController, NUXKeyboardResponder
}
}

private func configureSiteAddressHelpButton() {
WPStyleGuide.configureTextButton(siteAddressHelpButton)
}


// MARK: - Instance Methods

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class LoginUsernamePasswordViewController: LoginViewController, NUXKeyboardRespo
///
@objc func configureForgotPasswordButton() {
forgotPasswordButton.isEnabled = enableSubmit(animating: false)
WPStyleGuide.configureTextButton(forgotPasswordButton)
}


Expand Down
8 changes: 8 additions & 0 deletions WordPressAuthenticator/Signin/LoginWPComViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class LoginWPComViewController: LoginViewController, NUXKeyboardResponder {

configureTextFields()
configureEmailIcon()
configureForgotPasswordButton()
configureSubmitButton(animating: false)
configureViewForEditingIfNeeded()
}
Expand Down Expand Up @@ -128,6 +129,13 @@ class LoginWPComViewController: LoginViewController, NUXKeyboardResponder {
emailIcon?.image = image.imageWithTintColor(WordPressAuthenticator.shared.style.subheadlineColor)
}

private func configureForgotPasswordButton() {
guard let forgotPasswordButton = forgotPasswordButton else {
return
}
WPStyleGuide.configureTextButton(forgotPasswordButton)
}

@objc func localizeControls() {

instructionLabel?.text = {
Expand Down