mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 23:32:41 +00:00
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:
parent
4bd5c12f73
commit
9522304e19
2 changed files with 22 additions and 8 deletions
|
@ -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
1
changelog.d/3562.bugfix
Normal file
|
@ -0,0 +1 @@
|
|||
Authent: fix phone number validation through custom URL
|
Loading…
Reference in a new issue