Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added signup_flow_name attribute #190

Merged
merged 5 commits into from
Oct 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion WordPressKit.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "WordPressKit"
s.version = "4.5.1"
s.version = "4.5.2-beta.1"
s.summary = "WordPressKit offers a clean and simple WordPress.com and WordPress.org API."

s.description = <<-DESC
Expand Down
14 changes: 12 additions & 2 deletions WordPressKit/AccountServiceRemoteREST.m
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ - (void)requestWPComAuthLinkForEmail:(NSString *)email
path:path
clientID:clientID
clientSecret:clientSecret
extraParams: nil
wpcomScheme:scheme
success:success
failure:failure];
Expand All @@ -217,11 +218,14 @@ - (void)requestWPComSignupLinkForEmail:(NSString *)email

NSString *path = [self pathForEndpoint:@"auth/send-signup-email"
withVersion:ServiceRemoteWordPressComRESTApiVersion_1_1];


NSDictionary *signupFlowParam = @{@"signup_flow_name": @"mobile-ios"};

[self requestWPComMagicLinkForEmail:email
path:path
clientID:clientID
clientSecret:clientSecret
extraParams:signupFlowParam
wpcomScheme:scheme
success:success
failure:failure];
Expand All @@ -231,6 +235,7 @@ - (void)requestWPComMagicLinkForEmail:(NSString *)email
path:(NSString *)path
clientID:(NSString *)clientID
clientSecret:(NSString *)clientSecret
extraParams:(nullable NSDictionary *)extraParams
wpcomScheme:(NSString *)scheme
success:(void (^)(void))success
failure:(void (^)(NSError *error))failure
Expand All @@ -241,10 +246,15 @@ - (void)requestWPComMagicLinkForEmail:(NSString *)email
@"email": email,
@"client_id": clientID,
@"client_secret": clientSecret
}];
}];

if (![@"wordpress" isEqualToString:scheme]) {
[params setObject:scheme forKey:@"scheme"];
}

if (extraParams != nil) {
[params addEntriesFromDictionary:extraParams];
}

[self.wordPressComRestApi POST:path
parameters:[NSDictionary dictionaryWithDictionary:params]
Expand Down