marinofaggiana 3 年之前
父節點
當前提交
b0bf56ad27
共有 2 個文件被更改,包括 10 次插入3 次删除
  1. 2 0
      iOSClient/Login/NCLogin.swift
  2. 8 3
      iOSClient/Login/NCLoginWeb.swift

+ 2 - 0
iOSClient/Login/NCLogin.swift

@@ -337,6 +337,8 @@ class NCLogin: UIViewController, UITextFieldDelegate, NCLoginQRCodeDelegate {
                 NCUtility.shared.removeAllSettings()
             }
             
+            CCUtility.clearCertificateError(account)
+            
             NCManageDatabase.shared.deleteAccount(account)
             NCManageDatabase.shared.addAccount(account, urlBase: urlBase, user: user, password: password)
             

+ 8 - 3
iOSClient/Login/NCLoginWeb.swift

@@ -245,9 +245,6 @@ extension NCLoginWeb: WKNavigationDelegate {
         
         var urlBase = server
         
-        // NO account found, clear all
-        if NCManageDatabase.shared.getAccounts() == nil { NCUtility.shared.removeAllSettings() }
-            
         // Normalized
         if (urlBase.last == "/") {
             urlBase = String(urlBase.dropLast())
@@ -255,6 +252,14 @@ extension NCLoginWeb: WKNavigationDelegate {
         
         // Create account
         let account: String = "\(username) \(urlBase)"
+        
+        // NO account found, clear all
+        if NCManageDatabase.shared.getAccounts() == nil {
+            NCUtility.shared.removeAllSettings()
+        }
+        
+        // Clear certificate error 
+        CCUtility.clearCertificateError(account)
 
         // Add new account
         NCManageDatabase.shared.deleteAccount(account)