File tree 3 files changed +21
-9
lines changed
3 files changed +21
-9
lines changed Original file line number Diff line number Diff line change @@ -31,13 +31,17 @@ - (void) authorizeWithUrl:(NSString *)providerName
31
31
32
32
__weak id client = self;
33
33
[account authenticateWithHandler: ^(NSArray *responses, NSError *error) {
34
- [client clearPendingAccount ];
35
-
36
34
if (error != nil ) {
37
- onError (error);
35
+ NSString *response = ((DCTAuthResponse *)responses[0 ]).responseDescription ;
36
+ NSError *err = [NSError errorWithDomain: error.domain
37
+ code: error.code
38
+ userInfo: @{@" response" : response}];
39
+ onError (err);
38
40
return ;
39
41
}
40
42
43
+ [client clearPendingAccount ];
44
+
41
45
if (!account.authorized ) {
42
46
NSError *err = QUICK_ERROR (E_ACCOUNT_NOT_AUTHORIZED, @" account not authorized" );
43
47
onError (err);
Original file line number Diff line number Diff line change @@ -34,13 +34,17 @@ - (void) authorizeWithUrl:(NSString *)providerName
34
34
// authorizeWithClientID
35
35
[account authenticateWithHandler: ^(NSArray *responses, NSError *error) {
36
36
NSLog (@" authenticateWithHandler: %@ " , responses);
37
- [client clearPendingAccount ];
38
37
39
38
if (error != nil ) {
40
- NSLog (@" Some error: %@ " , error);
41
- onError (error);
39
+ NSString *response = ((DCTAuthResponse *)responses[0 ]).responseDescription ;
40
+ NSError *err = [NSError errorWithDomain: error.domain
41
+ code: error.code
42
+ userInfo: @{@" response" : response}];
43
+ onError (err);
42
44
return ;
43
45
}
46
+
47
+ [client clearPendingAccount ];
44
48
45
49
if (!account.authorized ) {
46
50
NSError *err = QUICK_ERROR (E_ACCOUNT_NOT_AUTHORIZED, @" account not authorized" );
@@ -63,7 +67,10 @@ - (void) reauthenticateWithHandler:(NSString *) providerName
63
67
[account reauthenticateWithHandler: ^(DCTAuthResponse *response, NSError *error) {
64
68
NSLog (@" Reauthenticating..." );
65
69
if (error != nil ) {
66
- onError (error);
70
+ NSError *err = [NSError errorWithDomain: error.domain
71
+ code: error.code
72
+ userInfo: @{@" response" : response.responseDescription }];
73
+ onError (err);
67
74
return ;
68
75
}
69
76
Original file line number Diff line number Diff line change @@ -360,11 +360,12 @@ - (NSDictionary *) getConfigForProvider:(NSString *)name
360
360
} onError: ^(NSError *error) {
361
361
NSLog (@" Error in authorizeWithUrl: %@ " , error);
362
362
_pendingAuthentication = NO ;
363
- [manager removePending: client];
364
363
callback (@[@{
365
364
@" status" : @" error" ,
366
- @" msg" : [error localizedDescription ]
365
+ @" msg" : [error localizedDescription ],
366
+ @" userInfo" : error.userInfo
367
367
}]);
368
+ [manager removePending: client];
368
369
}];
369
370
}
370
371
You can’t perform that action at this time.
0 commit comments