@@ -144,7 +144,7 @@ - (NSURLSessionTask *)authenticateUsingOAuthWithURLString:(NSString *)URLString
144144 password : (NSString *)password
145145 scope : (NSString *)scope
146146 success : (void (^)(AFOAuthCredential * _Nonnull))success
147- failure : (void (^)(NSError * _Nonnull))failure {
147+ failure : (void (^)(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull))failure {
148148 NSParameterAssert (username);
149149 NSParameterAssert (password);
150150
@@ -163,7 +163,7 @@ - (NSURLSessionTask *)authenticateUsingOAuthWithURLString:(NSString *)URLString
163163- (NSURLSessionTask *)authenticateUsingOAuthWithURLString : (NSString *)URLString
164164 scope : (NSString *)scope
165165 success : (void (^)(AFOAuthCredential * _Nonnull))success
166- failure : (void (^)(NSError * _Nonnull))failure {
166+ failure : (void (^)(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull))failure {
167167
168168 NSMutableDictionary *parameters = [NSMutableDictionary dictionary ];
169169 [parameters setValue: kAFOAuthClientCredentialsGrantType forKey: @" grant_type" ];
@@ -179,7 +179,7 @@ - (NSURLSessionTask *)authenticateUsingOAuthWithURLString:(NSString *)URLString
179179- (NSURLSessionTask *)authenticateUsingOAuthWithURLString : (NSString *)URLString
180180 refreshToken : (NSString *)refreshToken
181181 success : (void (^)(AFOAuthCredential *credential))success
182- failure : (void (^)(NSError *error))failure
182+ failure : (void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure
183183{
184184 NSParameterAssert (refreshToken);
185185
@@ -195,7 +195,7 @@ - (NSURLSessionTask *)authenticateUsingOAuthWithURLString:(NSString *)URLString
195195 code : (NSString *)code
196196 redirectURI : (NSString *)uri
197197 success : (void (^)(AFOAuthCredential *credential))success
198- failure : (void (^)(NSError *error))failure
198+ failure : (void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure
199199{
200200 NSParameterAssert (code);
201201 NSParameterAssert (uri);
@@ -212,7 +212,7 @@ - (NSURLSessionTask *)authenticateUsingOAuthWithURLString:(NSString *)URLString
212212- (NSURLSessionTask *)authenticateUsingOAuthWithURLString : (NSString *)URLString
213213 parameters : (NSDictionary *)parameters
214214 success : (void (^)(AFOAuthCredential *credential))success
215- failure : (void (^)(NSError *error))failure
215+ failure : (void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure
216216{
217217 NSMutableDictionary *mutableParameters = [NSMutableDictionary dictionaryWithDictionary: parameters];
218218 if (!self.useHTTPBasicAuthentication ) {
@@ -232,7 +232,7 @@ - (NSURLSessionTask *)authenticateUsingOAuthWithURLString:(NSString *)URLString
232232
233233 if ([responseObject valueForKey: @" error" ]) {
234234 if (failure) {
235- failure (AFErrorFromRFC6749Section5_2Error (responseObject));
235+ failure (task, AFErrorFromRFC6749Section5_2Error (responseObject));
236236 }
237237 }
238238
@@ -265,7 +265,7 @@ - (NSURLSessionTask *)authenticateUsingOAuthWithURLString:(NSString *)URLString
265265
266266 } failure: ^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
267267 if (failure) {
268- failure (error);
268+ failure (task, error);
269269 }
270270 }];
271271
0 commit comments