Fix phone number validation through custom URL (#5527)

* Fix phone number validation through custom URL

* Rename msisdnSubmissionHttpClient

Co-authored-by: Arnaud Ringenbach <arnaud.ringenbach@niji.fr>
This commit is contained in:
aringenbach 2022-02-10 09:25:20 +01:00 committed by GitHub
parent 4bd5c12f73
commit 9522304e19
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 8 deletions

View file

@ -29,6 +29,10 @@
@property (nonatomic) NSString *sid;
@property (nonatomic) MXIdentityService *identityService;
@property (nonatomic) NSString *submitUrl;
/**
HTTP client dedicated to sending MSISDN token to custom URLs.
*/
@property (nonatomic, strong) MXHTTPClient *msisdnSubmissionHttpClient;
@end
@ -255,14 +259,23 @@
@"token": token
};
MXHTTPClient *httpClient = [[MXHTTPClient alloc] initWithBaseURL:nil andOnUnrecognizedCertificateBlock:nil];
return [httpClient requestWithMethod:@"POST"
path:url
parameters:parameters
success:^(NSDictionary *JSONResponse) {
success();
}
failure:failure];
self.msisdnSubmissionHttpClient = [[MXHTTPClient alloc] initWithBaseURL:nil andOnUnrecognizedCertificateBlock:nil];
MXWeakify(self);
return [self.msisdnSubmissionHttpClient requestWithMethod:@"POST"
path:url
parameters:parameters
success:^(NSDictionary *JSONResponse) {
success();
MXStrongifyAndReturnIfNil(self);
self.msisdnSubmissionHttpClient = nil;
}
failure:^(NSError *error) {
failure(error);
MXStrongifyAndReturnIfNil(self);
self.msisdnSubmissionHttpClient = nil;
}];
}
- (void)add3PIDToUser:(BOOL)bind

1
changelog.d/3562.bugfix Normal file
View file

@ -0,0 +1 @@
Authent: fix phone number validation through custom URL