summaryrefslogtreecommitdiff
path: root/Juick/ViewControllers
diff options
context:
space:
mode:
Diffstat (limited to 'Juick/ViewControllers')
-rw-r--r--Juick/ViewControllers/DiscoverViewController.m2
-rw-r--r--Juick/ViewControllers/LoginViewController.m7
2 files changed, 2 insertions, 7 deletions
diff --git a/Juick/ViewControllers/DiscoverViewController.m b/Juick/ViewControllers/DiscoverViewController.m
index 27b273b..edbd152 100644
--- a/Juick/ViewControllers/DiscoverViewController.m
+++ b/Juick/ViewControllers/DiscoverViewController.m
@@ -24,7 +24,7 @@
-(void) viewDidLoad {
self.messagesDelegate = self;
if ([User isAuthenticated]) {
- [User checkIsValid:^(BOOL success) {
+ [[APIClient sharedClient] authenticate:^(BOOL success) {
if (success) {
if ([self.path length] == 0) {
self.path = [APIClient feedUrl];
diff --git a/Juick/ViewControllers/LoginViewController.m b/Juick/ViewControllers/LoginViewController.m
index e1b12f2..f8cbcc8 100644
--- a/Juick/ViewControllers/LoginViewController.m
+++ b/Juick/ViewControllers/LoginViewController.m
@@ -56,12 +56,8 @@
}
- (void) doneSignIn {
- [User checkIsValid:^(BOOL success) {
+ [[APIClient sharedClient] authenticate:^(BOOL success) {
if (success) {
- NSString *username = [SAMKeychain passwordForService:[[NSBundle mainBundle] bundleIdentifier] account:@"com.juick.username"];
- NSString *password = [SAMKeychain passwordForService:[[NSBundle mainBundle] bundleIdentifier] account:@"com.juick.password"];
- [[APIClient sharedClient].manager.requestSerializer setAuthorizationHeaderFieldWithUsername:username password:password];
-
[[AppDelegate shared] registerForRemoteNotifications];
CATransition* transition = [CATransition animation];
transition.duration = 0.3;
@@ -74,7 +70,6 @@
[User throwUnableToLogin:self];
}
}];
-
}
- (IBAction)passwordChanged:(id)sender {
if ([self.passwordField.text isKindOfClass:[NSString class]]) {