From 5f4a09ec689cb04ce71b4eb7425936f04a70f6f4 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 22 Mar 2019 00:33:30 +0300 Subject: Fix sign in --- Juick/APIClient.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Juick/APIClient.m') diff --git a/Juick/APIClient.m b/Juick/APIClient.m index 869e944..e2ef67d 100644 --- a/Juick/APIClient.m +++ b/Juick/APIClient.m @@ -67,7 +67,10 @@ } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { NSLog(@"REST Error: %@", error); [[NSOperationQueue mainQueue] addOperationWithBlock:^{ - callback(nil, error); + NSInteger statusCode = ((NSHTTPURLResponse *)task.response).statusCode; + if (statusCode == 401) { + callback(nil, [NSError errorWithDomain:@"JuickErrorDomain" code:401 userInfo:nil]); + } }]; }]; }]; -- cgit v1.2.3