diff options
author | Vitaly Takmazov | 2019-03-20 02:35:23 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2019-03-20 02:35:23 +0300 |
commit | 458e55b9cddcadb2bbbe3fb4002f06a5744b84c0 (patch) | |
tree | aa32d167c3a6914b1fd326085e94d2a2cb43b057 /Juick/ViewControllers/LoginViewController.m | |
parent | 1f3e08f107064fa429c6aa2a26702f6e63a791f0 (diff) |
Move all API calls to APIClient
Diffstat (limited to 'Juick/ViewControllers/LoginViewController.m')
-rw-r--r-- | Juick/ViewControllers/LoginViewController.m | 7 |
1 files changed, 1 insertions, 6 deletions
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]]) { |