File tree Expand file tree Collapse file tree 3 files changed +21
-9
lines changed Expand file tree Collapse file tree 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
3131
3232 __weak id client = self;
3333 [account authenticateWithHandler: ^(NSArray *responses, NSError *error) {
34- [client clearPendingAccount ];
35-
3634 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);
3840 return ;
3941 }
4042
43+ [client clearPendingAccount ];
44+
4145 if (!account.authorized ) {
4246 NSError *err = QUICK_ERROR (E_ACCOUNT_NOT_AUTHORIZED, @" account not authorized" );
4347 onError (err);
Original file line number Diff line number Diff line change @@ -34,13 +34,17 @@ - (void) authorizeWithUrl:(NSString *)providerName
3434 // authorizeWithClientID
3535 [account authenticateWithHandler: ^(NSArray *responses, NSError *error) {
3636 NSLog (@" authenticateWithHandler: %@ " , responses);
37- [client clearPendingAccount ];
3837
3938 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);
4244 return ;
4345 }
46+
47+ [client clearPendingAccount ];
4448
4549 if (!account.authorized ) {
4650 NSError *err = QUICK_ERROR (E_ACCOUNT_NOT_AUTHORIZED, @" account not authorized" );
@@ -63,7 +67,10 @@ - (void) reauthenticateWithHandler:(NSString *) providerName
6367 [account reauthenticateWithHandler: ^(DCTAuthResponse *response, NSError *error) {
6468 NSLog (@" Reauthenticating..." );
6569 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);
6774 return ;
6875 }
6976
Original file line number Diff line number Diff line change @@ -360,11 +360,12 @@ - (NSDictionary *) getConfigForProvider:(NSString *)name
360360 } onError: ^(NSError *error) {
361361 NSLog (@" Error in authorizeWithUrl: %@ " , error);
362362 _pendingAuthentication = NO ;
363- [manager removePending: client];
364363 callback (@[@{
365364 @" status" : @" error" ,
366- @" msg" : [error localizedDescription ]
365+ @" msg" : [error localizedDescription ],
366+ @" userInfo" : error.userInfo
367367 }]);
368+ [manager removePending: client];
368369 }];
369370}
370371
You can’t perform that action at this time.
0 commit comments