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

Commit 3e95dd7

Browse files
authored
Merge pull request #179 from wordpress-mobile/issue/auth_init_configs
Auth init: login configs
2 parents 1470051 + 82f590d commit 3e95dd7

File tree

5 files changed

+18
-12
lines changed

5 files changed

+18
-12
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.10.7-beta.1"
3+
s.version = "1.10.7-beta.2"
44
s.summary = "WordPressAuthenticator implements an easy and elegant way to authenticate your WordPress Apps."
55

66
s.description = <<-DESC

WordPressAuthenticator/Authenticator/WordPressAuthenticatorConfiguration.swift

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ public struct WordPressAuthenticatorConfiguration {
4646
let userAgent: String
4747

4848
/// Flag indicating which Log In flow to display.
49-
/// In the new flow, when Log In is selected, a button view is displayed with options.
50-
/// In the old flow, when Log In is selected, the email login view is displayed with alternative options.
49+
/// If enabled, when Log In is selected, a button view is displayed with options.
50+
/// If disabled, when Log In is selected, the email login view is displayed with alternative options.
5151
///
52-
let showNewLoginFlow: Bool
52+
let showLoginOptions: Bool
5353

5454
/// Flag indicating if the login options button view should be displayed in the site address flow.
5555
/// If enabled, the options button view will be displayed after the site address has been entered
@@ -61,6 +61,10 @@ public struct WordPressAuthenticatorConfiguration {
6161
///
6262
let enableSignInWithApple: Bool
6363

64+
/// Flag indicating if the unified login/signup flow should be displayed.
65+
///
66+
let enableUnifiedAuth: Bool
67+
6468
/// Designated Initializer
6569
///
6670
public init (wpcomClientId: String,
@@ -73,9 +77,10 @@ public struct WordPressAuthenticatorConfiguration {
7377
googleLoginServerClientId: String,
7478
googleLoginScheme: String,
7579
userAgent: String,
76-
showNewLoginFlow: Bool = false,
80+
showLoginOptions: Bool = false,
7781
showLoginOptionsFromSiteAddress: Bool = false,
78-
enableSignInWithApple: Bool = false) {
82+
enableSignInWithApple: Bool = false,
83+
enableUnifiedAuth: Bool = false) {
7984

8085
self.wpcomClientId = wpcomClientId
8186
self.wpcomSecret = wpcomSecret
@@ -87,8 +92,9 @@ public struct WordPressAuthenticatorConfiguration {
8792
self.googleLoginServerClientId = googleLoginServerClientId
8893
self.googleLoginScheme = googleLoginScheme
8994
self.userAgent = userAgent
90-
self.showNewLoginFlow = showNewLoginFlow
95+
self.showLoginOptions = showLoginOptions
9196
self.showLoginOptionsFromSiteAddress = showLoginOptionsFromSiteAddress
9297
self.enableSignInWithApple = enableSignInWithApple
98+
self.enableUnifiedAuth = enableUnifiedAuth
9399
}
94100
}

WordPressAuthenticator/Extensions/WPStyleGuide+Login.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ extension WPStyleGuide {
155155

156156
let button: UIButton
157157

158-
if WordPressAuthenticator.shared.configuration.showNewLoginFlow {
158+
if WordPressAuthenticator.shared.configuration.showLoginOptions {
159159
let baseString = NSLocalizedString("Or log in by _entering your site address_.", comment: "Label for button to log in using site address. Underscores _..._ denote underline.")
160160

161161
let attrStrNormal = baseString.underlined(color: style.subheadlineColor, underlineColor: style.textButtonColor)

WordPressAuthenticator/Signin/LoginEmailViewController.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ open class LoginEmailViewController: LoginViewController, NUXKeyboardResponder {
2929
var didFindSafariSharedCredentials = false
3030
var didRequestSafariSharedCredentials = false
3131
open var offerSignupOption = false
32-
private let showNewLoginFlow = WordPressAuthenticator.shared.configuration.showNewLoginFlow
32+
private let showLoginOptions = WordPressAuthenticator.shared.configuration.showLoginOptions
3333

3434
private struct Constants {
3535
static let alternativeLogInAnimationDuration: TimeInterval = 0.33
@@ -46,8 +46,8 @@ open class LoginEmailViewController: LoginViewController, NUXKeyboardResponder {
4646
localizeControls()
4747
setupOnePasswordButtonIfNeeded()
4848

49-
alternativeLoginLabel?.isHidden = showNewLoginFlow
50-
if !showNewLoginFlow {
49+
alternativeLoginLabel?.isHidden = showLoginOptions
50+
if !showLoginOptions {
5151
addGoogleButton()
5252
}
5353

WordPressAuthenticator/Signin/LoginPrologueViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class LoginPrologueViewController: LoginViewController {
105105
// MARK: - Actions
106106

107107
private func loginTapped() {
108-
if WordPressAuthenticator.shared.configuration.showNewLoginFlow {
108+
if WordPressAuthenticator.shared.configuration.showLoginOptions {
109109
performSegue(withIdentifier: .showLoginMethod, sender: self)
110110
} else {
111111
performSegue(withIdentifier: .showEmailLogin, sender: self)

0 commit comments

Comments
 (0)