diff options
author | 2019-10-31 16:16:48 +0300 | |
---|---|---|
committer | 2020-05-12 16:38:25 +0300 | |
commit | 9d78e7d654c51c22ce4be87efef5bc1f8d5a2d08 (patch) | |
tree | dfb028dfca07fdb7bbacc00771f9e865f28fd6d4 /Juick/ViewControllers/ThreadViewController.m | |
parent | 742e1a0e615a7e07a9f4b4c249227cd63839325f (diff) |
Fix authentication
Diffstat (limited to 'Juick/ViewControllers/ThreadViewController.m')
-rw-r--r-- | Juick/ViewControllers/ThreadViewController.m | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Juick/ViewControllers/ThreadViewController.m b/Juick/ViewControllers/ThreadViewController.m index c345822..8ee7623 100644 --- a/Juick/ViewControllers/ThreadViewController.m +++ b/Juick/ViewControllers/ThreadViewController.m @@ -9,14 +9,12 @@ #import "ThreadViewController.h" #import "NewPostViewController.h" #import "MessageCell.h" -#import "APIClient.h" -#import "AppDelegate.h" @implementation ThreadViewController -(void) viewDidLoad { - [self setPath:[APIClient threadUrl]]; + [self setPath:[API threadUrl]]; [super viewDidLoad]; self.messagesDelegate = self; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(replyPosted:) name:ReplyPostedNotificationName object:nil]; @@ -30,10 +28,10 @@ - (BOOL)shouldPerformSegueWithIdentifier:(NSString *)identifier sender:(id)sender { if ([identifier isEqualToString:@"editorSegue"]) { - if ([[APIClient sharedClient] isAuthenticated]) { + if ([[NSUserDefaults standardUserDefaults] stringForKey:@"token"]) { return YES; } else { - [[AppDelegate shared] presentLoginView:self]; + [[AppDelegate shared] unauthorized]; return NO; } } |