Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
44 changes: 13 additions & 31 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
PODS:
- 1PasswordExtension (1.8.5)
- AFNetworking (3.2.1):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any idea why the Podfile.lock changed so much without any changes to the Podfile?

- AFNetworking/NSURLSession (= 3.2.1)
- AFNetworking/Reachability (= 3.2.1)
- AFNetworking/Security (= 3.2.1)
- AFNetworking/Serialization (= 3.2.1)
- AFNetworking/UIKit (= 3.2.1)
- AFNetworking/NSURLSession (3.2.1):
- AFNetworking/Reachability
- AFNetworking/Security
- AFNetworking/Serialization
- AFNetworking/Reachability (3.2.1)
- AFNetworking/Security (3.2.1)
- AFNetworking/Serialization (3.2.1)
- AFNetworking/UIKit (3.2.1):
- AFNetworking/NSURLSession
- Alamofire (4.7.2)
- CocoaLumberjack (3.4.2):
- CocoaLumberjack/Default (= 3.4.2)
Expand All @@ -37,11 +22,11 @@ PODS:
- GoogleToolboxForMac/Defines (= 2.1.4)
- "GoogleToolboxForMac/NSString+URLArguments (= 2.1.4)"
- "GoogleToolboxForMac/NSString+URLArguments (2.1.4)"
- Gridicons (0.15)
- Gridicons (0.16)
- lottie-ios (2.5.0)
- NSObject-SafeExpectations (0.0.3)
- "NSURL+IDN (0.3)"
- OCMock (3.4.1)
- OCMock (3.4.2)
- OHHTTPStubs (6.1.0):
- OHHTTPStubs/Default (= 6.1.0)
- OHHTTPStubs/Core (6.1.0)
Expand All @@ -60,18 +45,17 @@ PODS:
- Specta (1.0.7)
- SVProgressHUD (2.2.5)
- UIDeviceIdentifier (0.5.0)
- WordPressKit (1.0.5):
- AFNetworking (= 3.2.1)
- Alamofire (= 4.7.2)
- WordPressKit (1.1):
- Alamofire (~> 4.7)
- CocoaLumberjack (= 3.4.2)
- NSObject-SafeExpectations (= 0.0.3)
- UIDeviceIdentifier (~> 0.4)
- WordPressShared (= 1.0.3)
- WordPressShared (~> 1.0.3)
- wpxmlrpc (= 0.8.3)
- WordPressShared (1.0.3):
- WordPressShared (1.0.8):
- CocoaLumberjack (~> 3.4)
- FormatterKit/TimeIntervalFormatter (= 1.8.2)
- WordPressUI (1.0.2)
- WordPressUI (1.0.5)
- wpxmlrpc (0.8.3)

DEPENDENCIES:
Expand All @@ -97,7 +81,6 @@ DEPENDENCIES:
SPEC REPOS:
https://github.com/cocoapods/specs.git:
- 1PasswordExtension
- AFNetworking
- Alamofire
- CocoaLumberjack
- Expecta
Expand All @@ -120,27 +103,26 @@ SPEC REPOS:

SPEC CHECKSUMS:
1PasswordExtension: 0e95bdea64ec8ff2f4f693be5467a09fac42a83d
AFNetworking: b6f891fdfaed196b46c7a83cf209e09697b94057
Alamofire: e4fa87002c137ba2d8d634d2c51fabcda0d5c223
CocoaLumberjack: db7cc9e464771f12054c22ff6947c5a58d43a0fd
Expecta: 3b6bd90a64b9a1dcb0b70aa0e10a7f8f631667d5
FormatterKit: 4b8f29acc9b872d5d12a63efb560661e8f2e1b98
GoogleSignInRepacked: d357702618c555f38923576924661325eb1ef22b
GoogleToolboxForMac: 91c824d21e85b31c2aae9bb011c5027c9b4e738f
Gridicons: 0e5e76ad9fc6f7cbc3da137a9751ef516c5aef73
Gridicons: 8cc5cb666d5ad8b8f1771d3c7a93d27ae25b7c2e
lottie-ios: d699fdee68d7b63e721d949388b015fef1aaa4ac
NSObject-SafeExpectations: b989b68a8a9b7b9f2b264a8b52ba9d7aab8f3129
"NSURL+IDN": 82355a0afd532fe1de08f6417c134b49b1a1c4b3
OCMock: 2cd0716969bab32a2283ff3a46fd26a8c8b4c5e3
OCMock: ebe9ee1dca7fbed0ff9193ac0b3e2d8862ea56f6
OHHTTPStubs: 1e21c7d2c084b8153fc53d48400d8919d2d432d0
Specta: 3e1bd89c3517421982dc4d1c992503e48bd5fe66
SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6
UIDeviceIdentifier: a959a6d4f51036b4180dd31fb26483a820f1cc46
WordPressKit: afe6d2c23db6d4f110638c25e86b029e899ffc34
WordPressShared: b8e910d8133a54e9452ab7bd9d8e27e78dc2f5ba
WordPressUI: 70bceaff582bdd6fd8f3ed67aaa200e72fce245d
WordPressKit: a24baaa783c3a221f2d9a51c19318cbb27333373
WordPressShared: 063e1e8b1a7aaf635abf17f091a2d235a068abdc
WordPressUI: ab90086350f1e26bf39e578e443d0abf0347e542
wpxmlrpc: bfc572f62ce7ee897f6f38b098d2ba08732ecef4

PODFILE CHECKSUM: adec9882e25404ab01a7a461fcdd3ddd937d5ba6

COCOAPODS: 1.5.2
COCOAPODS: 1.5.3
6 changes: 0 additions & 6 deletions WordPressAuthenticator.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
B56090CB208A4F5400399AE4 /* NUXNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B56090BD208A4F5400399AE4 /* NUXNavigationController.swift */; };
B56090CC208A4F5400399AE4 /* NUXTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B56090BE208A4F5400399AE4 /* NUXTableViewController.swift */; };
B56090CD208A4F5400399AE4 /* NUXSegueHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = B56090BF208A4F5400399AE4 /* NUXSegueHandler.swift */; };
B56090CE208A4F5400399AE4 /* NUXSubmitButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = B56090C0208A4F5400399AE4 /* NUXSubmitButton.swift */; };
B56090CF208A4F5400399AE4 /* NUXCollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B56090C1208A4F5400399AE4 /* NUXCollectionViewController.swift */; };
B56090D0208A4F5400399AE4 /* NUXViewControllerBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = B56090C2208A4F5400399AE4 /* NUXViewControllerBase.swift */; };
B56090D1208A4F5400399AE4 /* NUXViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B56090C3208A4F5400399AE4 /* NUXViewController.swift */; };
Expand Down Expand Up @@ -151,7 +150,6 @@
B56090BD208A4F5400399AE4 /* NUXNavigationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NUXNavigationController.swift; sourceTree = "<group>"; };
B56090BE208A4F5400399AE4 /* NUXTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NUXTableViewController.swift; sourceTree = "<group>"; };
B56090BF208A4F5400399AE4 /* NUXSegueHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NUXSegueHandler.swift; sourceTree = "<group>"; };
B56090C0208A4F5400399AE4 /* NUXSubmitButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NUXSubmitButton.swift; sourceTree = "<group>"; };
B56090C1208A4F5400399AE4 /* NUXCollectionViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NUXCollectionViewController.swift; sourceTree = "<group>"; };
B56090C2208A4F5400399AE4 /* NUXViewControllerBase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NUXViewControllerBase.swift; sourceTree = "<group>"; };
B56090C3208A4F5400399AE4 /* NUXViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NUXViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -357,7 +355,6 @@
B56090BB208A4F5300399AE4 /* NUXLinkMailViewController.swift */,
B56090BD208A4F5400399AE4 /* NUXNavigationController.swift */,
B56090BF208A4F5400399AE4 /* NUXSegueHandler.swift */,
B56090C0208A4F5400399AE4 /* NUXSubmitButton.swift */,
B56090BE208A4F5400399AE4 /* NUXTableViewController.swift */,
B56090C3208A4F5400399AE4 /* NUXViewController.swift */,
B56090C2208A4F5400399AE4 /* NUXViewControllerBase.swift */,
Expand Down Expand Up @@ -734,7 +731,6 @@
"${BUILT_PRODUCTS_DIR}/OHHTTPStubs/OHHTTPStubs.framework",
"${BUILT_PRODUCTS_DIR}/Specta/Specta.framework",
"${BUILT_PRODUCTS_DIR}/1PasswordExtension/OnePasswordExtension.framework",
"${BUILT_PRODUCTS_DIR}/AFNetworking/AFNetworking.framework",
"${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework",
"${BUILT_PRODUCTS_DIR}/CocoaLumberjack/CocoaLumberjack.framework",
"${BUILT_PRODUCTS_DIR}/FormatterKit/FormatterKit.framework",
Expand All @@ -758,7 +754,6 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OHHTTPStubs.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Specta.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OnePasswordExtension.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AFNetworking.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CocoaLumberjack.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FormatterKit.framework",
Expand Down Expand Up @@ -844,7 +839,6 @@
B56090E4208A4F9D00399AE4 /* WPNUXMainButton.m in Sources */,
B560913B208A563800399AE4 /* LoginSelfHostedViewController.swift in Sources */,
B5609136208A563800399AE4 /* Login2FAViewController.swift in Sources */,
B56090CE208A4F5400399AE4 /* NUXSubmitButton.swift in Sources */,
B56090E1208A4F9D00399AE4 /* WPWalkthroughTextField.m in Sources */,
B56090EF208A527000399AE4 /* WPStyleGuide+Login.swift in Sources */,
B56090D0208A4F5400399AE4 /* NUXViewControllerBase.swift in Sources */,
Expand Down
38 changes: 34 additions & 4 deletions WordPressAuthenticator/Authenticator/WordPressAuthenticator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import WordPressShared
import WordPressUI



// MARK: - WordPress Credentials
//
public enum WordPressCredentials {
Expand Down Expand Up @@ -179,6 +178,32 @@ public struct WordPressAuthenticatorConfiguration {
}


// MARK: - WordPress Authenticator Styles
//
public struct WordPressAuthenticatorStyle {
/// Alternative logins link color
///
let linkColor: UIColor

/// Alternative logins highlight color
///
let highlightColor: UIColor

/// Designated initializer
///
public init(linkColor: UIColor, highlightColor: UIColor) {
self.linkColor = linkColor
self.highlightColor = highlightColor
}
}

public extension WordPressAuthenticatorStyle {
static var defaultStyle: WordPressAuthenticatorStyle {
return WordPressAuthenticatorStyle(linkColor: WPStyleGuide.wordPressBlue(), highlightColor: WPStyleGuide.lightBlue())
}
}


// MARK: - WordPressAuthenticator: Public API to deal with WordPress.com and WordPress.org authentication.
//
@objc public class WordPressAuthenticator: NSObject {
Expand All @@ -205,6 +230,10 @@ public struct WordPressAuthenticatorConfiguration {
///
public let configuration: WordPressAuthenticatorConfiguration

/// Authenticator's Styles.
///
public let style: WordPressAuthenticatorStyle

/// Notification to be posted whenever the signing flow completes.
///
@objc public static let WPSigninDidFinishNotification = "WPSigninDidFinishNotification"
Expand All @@ -224,18 +253,19 @@ public struct WordPressAuthenticatorConfiguration {

/// Designated Initializer
///
private init(configuration: WordPressAuthenticatorConfiguration) {
private init(configuration: WordPressAuthenticatorConfiguration, style: WordPressAuthenticatorStyle) {
self.configuration = configuration
self.style = style
}

/// Initializes the WordPressAuthenticator with the specified Configuration.
///
public static func initialize(configuration: WordPressAuthenticatorConfiguration) {
public static func initialize(configuration: WordPressAuthenticatorConfiguration, style: WordPressAuthenticatorStyle) {
guard privateInstance == nil else {
fatalError("WordPressAuthenticator is already initialized")
}

privateInstance = WordPressAuthenticator(configuration: configuration)
privateInstance = WordPressAuthenticator(configuration: configuration, style: style)
}

// MARK: - Public Methods
Expand Down
36 changes: 0 additions & 36 deletions WordPressAuthenticator/Extensions/UIImage+Assets.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ extension UIImage {
return UIImage(named: "site-address-modal", in: bundle, compatibleWith: nil)!
}


/// Returns the Default Gravatar Placeholder Image.
///
@objc
Expand All @@ -27,41 +26,6 @@ extension UIImage {
return UIImage(named: "google", in: bundle, compatibleWith: nil)!
}

/// Returns the Link Image.
///
@objc
public static var beveledBlueButtonImage: UIImage {
return UIImage(named: "beveled-blue-button", in: bundle, compatibleWith: nil)!
}

/// Returns the Link Image.
///
@objc
public static var belevedBlueButtonDownImage: UIImage {
return UIImage(named: "beveled-blue-button-down", in: bundle, compatibleWith: nil)!
}

/// Returns the Link Image.
///
@objc
public static var beveledSecondaryButtonImage: UIImage {
return UIImage(named: "beveled-secondary-button", in: bundle, compatibleWith: nil)!
}

/// Returns the Link Image.
///
@objc
public static var beveledSecondaryButtonDownImage: UIImage {
return UIImage(named: "beveled-secondary-button-down", in: bundle, compatibleWith: nil)!
}

/// Returns the Link Image.
///
@objc
public static var beveledDisabledButtonImage: UIImage {
return UIImage(named: "beveled-disabled-button", in: bundle, compatibleWith: nil)!
}

/// Returns WordPressAuthenticator's Bundle
///
private static var bundle: Bundle {
Expand Down
9 changes: 5 additions & 4 deletions WordPressAuthenticator/Extensions/WPStyleGuide+Login.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ final class SubheadlineButton: UIButton {
super.traitCollectionDidChange(previousTraitCollection)
if previousTraitCollection?.preferredContentSizeCategory != traitCollection.preferredContentSizeCategory {
titleLabel?.font = WPStyleGuide.mediumWeightFont(forStyle: .subheadline)
titleLabel?.textColor = WPStyleGuide.wordPressBlue()
}
}
}
Expand Down Expand Up @@ -102,8 +103,8 @@ extension WPStyleGuide {
class func googleLoginButton() -> UIButton {
let baseString = NSLocalizedString("{G} Log in with Google.", comment: "Label for button to log in using Google. The {G} will be replaced with the Google logo.")

let attrStrNormal = googleButtonString(baseString, linkColor: WPStyleGuide.wordPressBlue())
let attrStrHighlight = googleButtonString(baseString, linkColor: WPStyleGuide.lightBlue())
let attrStrNormal = googleButtonString(baseString, linkColor: WordPressAuthenticator.shared.style.linkColor)
let attrStrHighlight = googleButtonString(baseString, linkColor: WordPressAuthenticator.shared.style.highlightColor)

let font = WPStyleGuide.mediumWeightFont(forStyle: .subheadline)

Expand All @@ -117,8 +118,8 @@ extension WPStyleGuide {
class func selfHostedLoginButton() -> UIButton {
let baseString = NSLocalizedString("Log in by entering your site address.", comment: "Label for button to log in using your site address.")

let attrStrNormal = selfHostedButtonString(baseString, linkColor: WPStyleGuide.wordPressBlue())
let attrStrHighlight = selfHostedButtonString(baseString, linkColor: WPStyleGuide.lightBlue())
let attrStrNormal = selfHostedButtonString(baseString, linkColor: WordPressAuthenticator.shared.style.linkColor)
let attrStrHighlight = selfHostedButtonString(baseString, linkColor: WordPressAuthenticator.shared.style.highlightColor)

let font = WPStyleGuide.mediumWeightFont(forStyle: .subheadline)

Expand Down
Loading