summaryrefslogtreecommitdiff
path: root/Juick/APIClient.m
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-03-21 13:55:21 +0300
committerGravatar Vitaly Takmazov2019-03-21 14:09:26 +0300
commit7d16bf22b2ae69a7a6512587b28414a59aa95995 (patch)
treef73a738757acdbec36f123c4162127d6b1eb4330 /Juick/APIClient.m
parent2ddd7f7964d09236b43485c795970038dd1c309f (diff)
Move isAuthenticated to APIClient
Diffstat (limited to 'Juick/APIClient.m')
-rw-r--r--Juick/APIClient.m4
1 files changed, 4 insertions, 0 deletions
diff --git a/Juick/APIClient.m b/Juick/APIClient.m
index f637710..44e7537 100644
--- a/Juick/APIClient.m
+++ b/Juick/APIClient.m
@@ -200,6 +200,10 @@
} ];
}
+-(BOOL) isAuthenticated {
+ NSString *password = [SAMKeychain passwordForService:[[NSBundle mainBundle] bundleIdentifier] account:@"com.juick.password"];
+ return password != nil;
+}
- (void)fetchImageWithURL:(NSURL *)url callback:(void (^)(NSData *))callback {
NSURLSessionDataTask *dataTask = [self.urlSession dataTaskWithURL:url completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {