summaryrefslogtreecommitdiff
path: root/Juick/Model/Message.m
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-01-19 23:38:50 +0300
committerGravatar Vitaly Takmazov2017-01-19 23:38:50 +0300
commit917fd3b930b8c25551b751608b9bd0dd104b56e5 (patch)
treef6e5d623c402d83b2868cb07b963c0bc5af5150f /Juick/Model/Message.m
parent87c992e9db9464215d12a3987fe384d65e96bc50 (diff)
Handle changed password
Diffstat (limited to 'Juick/Model/Message.m')
-rw-r--r--Juick/Model/Message.m6
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];
+ }
}];
}