diff --git a/CHANGELOG.md b/CHANGELOG.md index de802a19..b287cf40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ _None._ ### New Features - Add support for logging in into WPCOM suspended sites. +- Update `WordPressComAccountService/requestAuthenticationLink` with a new argument `createAccountIfNotFound` to allow creating new accounts. ### Bug Fixes diff --git a/Podfile b/Podfile index 6f1ba9bf..dfdb2573 100644 --- a/Podfile +++ b/Podfile @@ -31,7 +31,7 @@ def wordpress_authenticator_pods ## These should match the version requirement from the podspec. pod 'Gridicons', '~> 1.0' pod 'WordPressUI', '~> 1.7-beta' - pod 'WordPressKit', '~> 17.0' + pod 'WordPressKit', git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', commit: 'ba7389db54376be9c657b29316ef65b308405c3b' pod 'WordPressShared', '~> 2.1-beta' third_party_pods diff --git a/Podfile.lock b/Podfile.lock index b23203b0..917ef283 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -15,7 +15,7 @@ PODS: - WordPressKit (~> 17.0) - WordPressShared (~> 2.1-beta) - WordPressUI (~> 1.7-beta) - - WordPressKit (17.0.0): + - WordPressKit (17.3.0): - NSObject-SafeExpectations (~> 0.0.4) - UIDeviceIdentifier (~> 2.0) - WordPressShared (~> 2.0-beta) @@ -33,7 +33,7 @@ DEPENDENCIES: - SVProgressHUD (= 2.2.5) - SwiftLint (= 0.54.0) - WordPressAuthenticator (from `.`) - - WordPressKit (~> 17.0) + - WordPressKit (from `https://github.com/wordpress-mobile/WordPressKit-iOS.git`, commit `ba7389db54376be9c657b29316ef65b308405c3b`) - WordPressShared (~> 2.1-beta) - WordPressUI (~> 1.7-beta) @@ -48,7 +48,6 @@ SPEC REPOS: - SVProgressHUD - SwiftLint - UIDeviceIdentifier - - WordPressKit - WordPressShared - WordPressUI - wpxmlrpc @@ -56,6 +55,14 @@ SPEC REPOS: EXTERNAL SOURCES: WordPressAuthenticator: :path: "." + WordPressKit: + :commit: ba7389db54376be9c657b29316ef65b308405c3b + :git: https://github.com/wordpress-mobile/WordPressKit-iOS.git + +CHECKOUT OPTIONS: + WordPressKit: + :commit: ba7389db54376be9c657b29316ef65b308405c3b + :git: https://github.com/wordpress-mobile/WordPressKit-iOS.git SPEC CHECKSUMS: Expecta: 3b6bd90a64b9a1dcb0b70aa0e10a7f8f631667d5 @@ -68,11 +75,11 @@ SPEC CHECKSUMS: SwiftLint: c1de071d9d08c8aba837545f6254315bc900e211 UIDeviceIdentifier: 442b65b4ff1832d4ca9c2a157815cb29ad981b17 WordPressAuthenticator: d151cc7ebc1cfcbf5c28bb2c9afe760a75b49ba6 - WordPressKit: a71cc550f4b525ab5eef057984c8de071462edd5 + WordPressKit: faf8c6de7c2acfe71cf95b4db896901060967089 WordPressShared: 87f3ee89b0a3e83106106f13a8b71605fb8eb6d2 WordPressUI: a491454affda3b0fb812812e637dc5e8f8f6bd06 wpxmlrpc: 68db063041e85d186db21f674adf08d9c70627fd -PODFILE CHECKSUM: 98c48a8558a07d876e1720351adcb835bc40ce14 +PODFILE CHECKSUM: e9ff0e92f3449391df3719ac05bdf9b98f1da7ff COCOAPODS: 1.14.3 diff --git a/WordPressAuthenticator/Services/WordPressComAccountService.swift b/WordPressAuthenticator/Services/WordPressComAccountService.swift index ac348b55..375751d9 100644 --- a/WordPressAuthenticator/Services/WordPressComAccountService.swift +++ b/WordPressAuthenticator/Services/WordPressComAccountService.swift @@ -47,7 +47,10 @@ public class WordPressComAccountService { /// Requests a WordPress.com Authentication Link to be sent to the specified email address. /// - public func requestAuthenticationLink(for email: String, jetpackLogin: Bool, success: @escaping () -> Void, failure: @escaping (Error) -> Void) { + public func requestAuthenticationLink(for email: String, + jetpackLogin: Bool, + createAccountIfNotFound: Bool = false, + success: @escaping () -> Void, failure: @escaping (Error) -> Void) { let remote = AccountServiceRemoteREST(wordPressComRestApi: anonymousAPI) remote.requestWPComAuthLink(forEmail: email, @@ -55,6 +58,7 @@ public class WordPressComAccountService { clientSecret: configuration.wpcomSecret, source: jetpackLogin ? .jetpackConnect : .default, wpcomScheme: configuration.wpcomScheme, + createAccountIfNotFound: createAccountIfNotFound, success: success, failure: { error in let result = error ?? ServiceError.unknown