Skip to content

Commit

Permalink
Add support for requesting account creation when sending magic link
Browse files Browse the repository at this point in the history
  • Loading branch information
hichamboushaba committed Nov 14, 2024
1 parent 8fad7a6 commit bac645f
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,18 @@ 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,
clientID: configuration.wpcomClientId,
clientSecret: configuration.wpcomSecret,
source: jetpackLogin ? .jetpackConnect : .default,
wpcomScheme: configuration.wpcomScheme,
createAccountIfNotExists: createAccountIfNotFound,
success: success,
failure: { error in
let result = error ?? ServiceError.unknown
Expand Down

0 comments on commit bac645f

Please sign in to comment.