From e952ebf7cb6697c6c1d405d0adad4acf6397c335 Mon Sep 17 00:00:00 2001 From: Hicham Boushaba Date: Thu, 14 Nov 2024 15:48:41 +0100 Subject: [PATCH] Add support for requesting account creation when sending magic link --- .../Services/WordPressComAccountService.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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