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

Commit f81b854

Browse files
authored
Added signup_flow_name attribute (#190)
* Added signup_flow_name attribute to account creation with email * Now adding the param in the right place * Adding sign_up_flow as an extra param * remove comma * bump version
1 parent d1ed2c5 commit f81b854

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

WordPressKit.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 = "WordPressKit"
3-
s.version = "4.5.1"
3+
s.version = "4.5.2-beta.1"
44
s.summary = "WordPressKit offers a clean and simple WordPress.com and WordPress.org API."
55

66
s.description = <<-DESC

WordPressKit/AccountServiceRemoteREST.m

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ - (void)requestWPComAuthLinkForEmail:(NSString *)email
202202
path:path
203203
clientID:clientID
204204
clientSecret:clientSecret
205+
extraParams: nil
205206
wpcomScheme:scheme
206207
success:success
207208
failure:failure];
@@ -217,11 +218,14 @@ - (void)requestWPComSignupLinkForEmail:(NSString *)email
217218

218219
NSString *path = [self pathForEndpoint:@"auth/send-signup-email"
219220
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1];
220-
221+
222+
NSDictionary *signupFlowParam = @{@"signup_flow_name": @"mobile-ios"};
223+
221224
[self requestWPComMagicLinkForEmail:email
222225
path:path
223226
clientID:clientID
224227
clientSecret:clientSecret
228+
extraParams:signupFlowParam
225229
wpcomScheme:scheme
226230
success:success
227231
failure:failure];
@@ -231,6 +235,7 @@ - (void)requestWPComMagicLinkForEmail:(NSString *)email
231235
path:(NSString *)path
232236
clientID:(NSString *)clientID
233237
clientSecret:(NSString *)clientSecret
238+
extraParams:(nullable NSDictionary *)extraParams
234239
wpcomScheme:(NSString *)scheme
235240
success:(void (^)(void))success
236241
failure:(void (^)(NSError *error))failure
@@ -241,10 +246,15 @@ - (void)requestWPComMagicLinkForEmail:(NSString *)email
241246
@"email": email,
242247
@"client_id": clientID,
243248
@"client_secret": clientSecret
244-
}];
249+
}];
250+
245251
if (![@"wordpress" isEqualToString:scheme]) {
246252
[params setObject:scheme forKey:@"scheme"];
247253
}
254+
255+
if (extraParams != nil) {
256+
[params addEntriesFromDictionary:extraParams];
257+
}
248258

249259
[self.wordPressComRestApi POST:path
250260
parameters:[NSDictionary dictionaryWithDictionary:params]

0 commit comments

Comments
 (0)