mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-21 17:12:45 +02:00
Integrations: Fix terms consent display HTTP requests
This commit is contained in:
@@ -522,7 +522,7 @@ NSString *const WidgetManagerErrorDomain = @"WidgetManagerErrorDomain";
|
||||
MXStrongifyAndReturnIfNil(self);
|
||||
|
||||
// Exchange the token for a scalar token
|
||||
MXHTTPClient *httpClient = [[MXHTTPClient alloc] initWithBaseURL:config.apiUrl andOnUnrecognizedCertificateBlock:nil];
|
||||
__block MXHTTPClient *httpClient = [[MXHTTPClient alloc] initWithBaseURL:config.apiUrl andOnUnrecognizedCertificateBlock:nil];
|
||||
|
||||
MXHTTPOperation *operation2 =
|
||||
[httpClient requestWithMethod:@"POST"
|
||||
@@ -530,6 +530,7 @@ NSString *const WidgetManagerErrorDomain = @"WidgetManagerErrorDomain";
|
||||
parameters:tokenObject.JSONDictionary
|
||||
success:^(NSDictionary *JSONResponse)
|
||||
{
|
||||
httpClient = nil;
|
||||
|
||||
NSString *scalarToken;
|
||||
MXJSONModelSetString(scalarToken, JSONResponse[@"scalar_token"])
|
||||
@@ -551,6 +552,8 @@ NSString *const WidgetManagerErrorDomain = @"WidgetManagerErrorDomain";
|
||||
[operation mutateTo:operation3];
|
||||
|
||||
} failure:^(NSError *error) {
|
||||
httpClient = nil;
|
||||
|
||||
NSLog(@"[WidgetManager] registerForScalarToken: Failed to register. Error: %@", error);
|
||||
|
||||
if (failure)
|
||||
@@ -594,12 +597,13 @@ NSString *const WidgetManagerErrorDomain = @"WidgetManagerErrorDomain";
|
||||
return nil;
|
||||
}
|
||||
|
||||
MXHTTPClient *httpClient = [[MXHTTPClient alloc] initWithBaseURL:config.apiUrl andOnUnrecognizedCertificateBlock:nil];
|
||||
__block MXHTTPClient *httpClient = [[MXHTTPClient alloc] initWithBaseURL:config.apiUrl andOnUnrecognizedCertificateBlock:nil];
|
||||
|
||||
return [httpClient requestWithMethod:@"GET"
|
||||
path:[NSString stringWithFormat:@"account?v=1.1&scalar_token=%@", scalarToken]
|
||||
parameters:nil
|
||||
success:^(NSDictionary *JSONResponse) {
|
||||
httpClient = nil;
|
||||
|
||||
NSString *userId;
|
||||
MXJSONModelSetString(userId, JSONResponse[@"user_id"])
|
||||
@@ -615,6 +619,8 @@ NSString *const WidgetManagerErrorDomain = @"WidgetManagerErrorDomain";
|
||||
}
|
||||
|
||||
} failure:^(NSError *error) {
|
||||
httpClient = nil;
|
||||
|
||||
NSHTTPURLResponse *urlResponse = [MXHTTPOperation urlResponseFromError:error];
|
||||
|
||||
NSLog(@"[WidgetManager] validateScalarToken. Error in modular/account request. statusCode: %@", @(urlResponse.statusCode));
|
||||
|
||||
Reference in New Issue
Block a user