diff options
author | Vitaly Takmazov | 2019-10-02 17:16:01 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2019-10-02 17:16:01 +0300 |
commit | bf573afb9d05ce34ecd22b3dca85aca2c3896ae6 (patch) | |
tree | 2b55dfddb6d31f81294f2554d85bf41607a63f07 /Juick/APIClient.m | |
parent | 33539a3c9c8534776722aa1148499f984e0019e7 (diff) |
Shared navigation
Diffstat (limited to 'Juick/APIClient.m')
-rw-r--r-- | Juick/APIClient.m | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Juick/APIClient.m b/Juick/APIClient.m index 848ea77..c7e22cf 100644 --- a/Juick/APIClient.m +++ b/Juick/APIClient.m @@ -175,10 +175,12 @@ - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable))completionHandler { if (challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodHTTPBasic) { - completionHandler(NSURLSessionAuthChallengeUseCredential, self.credential); - } else { - completionHandler(NSURLSessionAuthChallengePerformDefaultHandling, nil); + if (self.isAuthenticated) { + completionHandler(NSURLSessionAuthChallengeUseCredential, self.credential); + return; + } } + completionHandler(NSURLSessionAuthChallengePerformDefaultHandling, nil); } -(void) fetchDataWithURL:(NSURL *) url data:(NSData *)postData boundary:(NSString *)boundary callback:(void(^)(NSData *, NSError *))callback { |