From da64667f6ef19bfeedb8b4b40d875fcd10d4ef6c Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 25 Dec 2018 10:19:50 +0300 Subject: Trying to not request without password --- Juick/APIClient.m | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Juick/APIClient.m') diff --git a/Juick/APIClient.m b/Juick/APIClient.m index 6f69e9d..3c91173 100644 --- a/Juick/APIClient.m +++ b/Juick/APIClient.m @@ -32,6 +32,10 @@ self.manager = [[AFHTTPSessionManager alloc] initWithBaseURL:[NSURL URLWithString:baseURLString]]; self.manager.requestSerializer = [AFJSONRequestSerializer new]; [self.manager.requestSerializer setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData]; + NSString *username = [[PDKeychainBindings sharedKeychainBindings] stringForKey:@"com.juick.username"]; + if (username) { + [self.manager.requestSerializer setAuthorizationHeaderFieldWithUsername:username password:[[PDKeychainBindings sharedKeychainBindings] stringForKey:@"com.juick.password"]]; + } self.backgroundQueue = [NSOperationQueue new]; self.dateFormatter = [[NSDateFormatter alloc] init]; self.dateFormatter.dateFormat = @"yyyy-MM-dd HH:mm:ss"; -- cgit v1.2.3