diff options
Diffstat (limited to 'Juick/Model/Message.m')
-rw-r--r-- | Juick/Model/Message.m | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Juick/Model/Message.m b/Juick/Model/Message.m index a4bcd2c..a7934ac 100644 --- a/Juick/Model/Message.m +++ b/Juick/Model/Message.m @@ -8,6 +8,7 @@ #import "Message.h" #import "PDKeychainBindings.h" +#import "AppDelegate.h" @implementation Message @@ -34,6 +35,11 @@ callback(messages); } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { NSLog(@"REST Error: %@", error); + NSInteger statusCode = ((NSHTTPURLResponse *)task.response).statusCode; + if (statusCode == 401) { + AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate; + [appDelegate pushLoginForm]; + } }]; } |