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

Commit bac645f

Browse files
Add support for requesting account creation when sending magic link
1 parent 8fad7a6 commit bac645f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

WordPressAuthenticator/Services/WordPressComAccountService.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,18 @@ public class WordPressComAccountService {
4848
/// Requests a WordPress.com Authentication Link to be sent to the specified email address.
4949
///
5050
public func requestAuthenticationLink(for email: String, jetpackLogin: Bool, success: @escaping () -> Void, failure: @escaping (Error) -> Void) {
51+
public func requestAuthenticationLink(for email: String,
52+
jetpackLogin: Bool,
53+
createAccountIfNotFound: Bool = false,
54+
success: @escaping () -> Void, failure: @escaping (Error) -> Void) {
5155
let remote = AccountServiceRemoteREST(wordPressComRestApi: anonymousAPI)
5256

5357
remote.requestWPComAuthLink(forEmail: email,
5458
clientID: configuration.wpcomClientId,
5559
clientSecret: configuration.wpcomSecret,
5660
source: jetpackLogin ? .jetpackConnect : .default,
5761
wpcomScheme: configuration.wpcomScheme,
62+
createAccountIfNotExists: createAccountIfNotFound,
5863
success: success,
5964
failure: { error in
6065
let result = error ?? ServiceError.unknown

0 commit comments

Comments
 (0)