Selaa lähdekoodia

fix bad response /ocs/v1.php/cloud/users #331

Marino Faggiana 7 vuotta sitten
vanhempi
commit
3c6b18f1e6
1 muutettua tiedostoa jossa 14 lisäystä ja 10 poistoa
  1. 14 10
      iOSClient/Login/CCLogin.m

+ 14 - 10
iOSClient/Login/CCLogin.m

@@ -341,17 +341,21 @@
     // Set this account as default
     tableAccount *tbAccount = [[NCManageDatabase sharedInstance] setAccountActive:metadataNet.account];
     
-    // Setting App active account
-    [app settingActiveAccount:tbAccount.account activeUrl:tbAccount.url activeUser:tbAccount.user activePassword:tbAccount.password];
+    // Verify account
+    if ([tbAccount.account isEqualToString:metadataNet.account]) {
     
-    // Update User
-    [[NCManageDatabase sharedInstance] setAccountsUserProfile:userProfile];
-
-    // Dismiss
-    [self.delegate loginSuccess:_loginType];
-    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
-        [self dismissViewControllerAnimated:YES completion:nil];
-    });
+        // Setting App active account
+        [app settingActiveAccount:tbAccount.account activeUrl:tbAccount.url activeUser:tbAccount.user activePassword:tbAccount.password];
+    
+        // Update User
+        [[NCManageDatabase sharedInstance] setAccountsUserProfile:userProfile];
+
+        // Dismiss
+        [self.delegate loginSuccess:_loginType];
+        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
+            [self dismissViewControllerAnimated:YES completion:nil];
+        });
+    }
 }
 
 #pragma --------------------------------------------------------------------------------------------