From 0eeed4b289e3631b7ff9fc3a30a5e4d36ba4072a Mon Sep 17 00:00:00 2001 From: Marino Faggiana Date: Sat, 20 Jul 2024 13:12:15 +0200 Subject: [PATCH 1/7] coding Signed-off-by: Marino Faggiana --- iOSClient/AppDelegate.swift | 24 ++++++--- iOSClient/Login/NCLogin.swift | 70 +++++++++++---------------- iOSClient/Login/NCLoginPoll.swift | 2 +- iOSClient/Login/NCLoginProvider.swift | 66 +++++++++---------------- 4 files changed, 70 insertions(+), 92 deletions(-) diff --git a/iOSClient/AppDelegate.swift b/iOSClient/AppDelegate.swift index 73a2c99a90..a11213e280 100644 --- a/iOSClient/AppDelegate.swift +++ b/iOSClient/AppDelegate.swift @@ -464,18 +464,26 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD // MARK: - Account - func createAccount(server: String, username: String, password: String, completion: @escaping (_ error: NKError) -> Void) { - var urlBase = server - if urlBase.last == "/" { urlBase = String(urlBase.dropLast()) } - let account: String = "\(username) \(urlBase)" - let user = username - - NextcloudKit.shared.setup(account: account, user: user, userId: user, password: password, urlBase: urlBase, groupIdentifier: NCBrandOptions.shared.capabilitiesGroup) - NextcloudKit.shared.getUserProfile { _, userProfile, _, error in + func createAccount(url: String, + user: String, + password: String, + completion: @escaping (_ error: NKError) -> Void) { + NextcloudKit.shared.getUserProfile(url: url, user: user, password: password, userAgent: userAgent) { userProfile, _, error in if error == .success, let userProfile { + var urlBase = url + if urlBase.last == "/" { urlBase = String(urlBase.dropLast()) } + let account: String = "\(userProfile.userId)@\(urlBase)" + + /// OLD account compatibility remove account + let oldAccount: String = "\(user) \(urlBase)" + NCManageDatabase.shared.deleteAccount(oldAccount) + /// + NCManageDatabase.shared.deleteAccount(account) NCManageDatabase.shared.addAccount(account, urlBase: urlBase, user: user, userId: userProfile.userId, password: password) + NCKeychain().setClientCertificate(account: account, p12Data: NCNetworking.shared.p12Data, p12Password: NCNetworking.shared.p12Password) + self.changeAccount(account, userProfile: userProfile) } else { let alertController = UIAlertController(title: NSLocalizedString("_error_", comment: ""), message: error.errorDescription, preferredStyle: .alert) diff --git a/iOSClient/Login/NCLogin.swift b/iOSClient/Login/NCLogin.swift index 63afdd092f..9ba5b3d031 100644 --- a/iOSClient/Login/NCLogin.swift +++ b/iOSClient/Login/NCLogin.swift @@ -217,15 +217,13 @@ class NCLogin: UIViewController, UITextFieldDelegate, NCLoginQRCodeDelegate { } // AppConfig - if let serverUrl = configServerUrl { - if let username = self.configUsername, let password = configAppPassword { - createAccount(server: serverUrl, username: username, password: password) - return - } else if let username = self.configUsername, let password = configPassword { - getAppPassword(serverUrl: serverUrl, username: username, password: password) - return + if let url = configServerUrl { + if let user = self.configUsername, let password = configAppPassword { + appDelegate.createAccount(url: url, user: user, password: password) { _ in } + } else if let user = self.configUsername, let password = configPassword { + getAppPassword(url: url, user: user, password: password) } else { - urlBase = serverUrl + urlBase = url } } } @@ -426,17 +424,8 @@ class NCLogin: UIViewController, UITextFieldDelegate, NCLoginQRCodeDelegate { if let host = URL(string: url)?.host { NCNetworking.shared.writeCertificate(host: host) } - let urlBase = url - let account = user + " " + user - - NextcloudKit.shared.setup(account: account, user: user, userId: user, password: password, urlBase: urlBase, groupIdentifier: NCBrandOptions.shared.capabilitiesGroup) - NextcloudKit.shared.getUserProfile { _, userProfile, _, error in - if error == .success, let userProfile { - NCManageDatabase.shared.deleteAccount(account) - NCManageDatabase.shared.addAccount(account, urlBase: url, user: user, userId: userProfile.userId, password: password) - - self.appDelegate.changeAccount(account, userProfile: userProfile) - + appDelegate.createAccount(url: url, user: user, password: password) { error in + if error == .success { let window = UIApplication.shared.firstWindow if window?.rootViewController is NCMainTabBarController { self.dismiss(animated: true) @@ -483,31 +472,30 @@ class NCLogin: UIViewController, UITextFieldDelegate, NCLoginQRCodeDelegate { } } - private func createAccount(server: String, username: String, password: String) { - appDelegate.createAccount(server: server, username: username, password: password) { error in - if error == .success { - let window = UIApplication.shared.firstWindow - if window?.rootViewController is NCMainTabBarController { - self.dismiss(animated: true) - } else { - if let mainTabBarController = UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController() as? NCMainTabBarController { - mainTabBarController.modalPresentationStyle = .fullScreen - mainTabBarController.view.alpha = 0 - window?.rootViewController = mainTabBarController - window?.makeKeyAndVisible() - UIView.animate(withDuration: 0.5) { - mainTabBarController.view.alpha = 1 + private func getAppPassword(url: String, user: String, password: String) { + NextcloudKit.shared.getAppPassword(url: url, user: user, password: password) { token, _, error in + if error == .success, let password = token { + self.appDelegate.createAccount(url: url, user: user, password: password) { error in + if error == .success { + let window = UIApplication.shared.firstWindow + if window?.rootViewController is NCMainTabBarController { + self.dismiss(animated: true) + } else { + if let mainTabBarController = UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController() as? NCMainTabBarController { + mainTabBarController.modalPresentationStyle = .fullScreen + mainTabBarController.view.alpha = 0 + window?.rootViewController = mainTabBarController + window?.makeKeyAndVisible() + UIView.animate(withDuration: 0.5) { + mainTabBarController.view.alpha = 1 + } + } } + } else { + NCContentPresenter().showError(error: error) + self.dismiss(animated: true, completion: nil) } } - } - } - } - - private func getAppPassword(serverUrl: String, username: String, password: String) { - NextcloudKit.shared.getAppPassword(serverUrl: serverUrl, username: username, password: password) { token, _, error in - if error == .success, let password = token { - self.createAccount(server: serverUrl, username: username, password: password) } else { NCContentPresenter().showError(error: error) self.dismiss(animated: true, completion: nil) diff --git a/iOSClient/Login/NCLoginPoll.swift b/iOSClient/Login/NCLoginPoll.swift index c7a7a4edaa..cdd95a7dba 100644 --- a/iOSClient/Login/NCLoginPoll.swift +++ b/iOSClient/Login/NCLoginPoll.swift @@ -137,7 +137,7 @@ private class LoginManager: ObservableObject { } private func createAccount(server: String, username: String, password: String) { - appDelegate.createAccount(server: server, username: username, password: password) { error in + appDelegate.createAccount(url: server, user: username, password: password) { error in if error == .success { self.pollFinished = true } diff --git a/iOSClient/Login/NCLoginProvider.swift b/iOSClient/Login/NCLoginProvider.swift index 1714074e40..3d7eb65790 100644 --- a/iOSClient/Login/NCLoginProvider.swift +++ b/iOSClient/Login/NCLoginProvider.swift @@ -128,12 +128,32 @@ extension NCLoginProvider: WKNavigationDelegate { } if !server.isEmpty, !user.isEmpty, !password.isEmpty { - - let server: String = server.replacingOccurrences(of: "/server:", with: "") - let username: String = user.replacingOccurrences(of: "user:", with: "").replacingOccurrences(of: "+", with: " ") + let url: String = server.replacingOccurrences(of: "/server:", with: "") + let user: String = user.replacingOccurrences(of: "user:", with: "").replacingOccurrences(of: "+", with: " ") let password: String = password.replacingOccurrences(of: "password:", with: "") - createAccount(server: server, username: username, password: password) + appDelegate.createAccount(url: url, user: user, password: password) { error in + if error == .success { + let window = UIApplication.shared.firstWindow + if window?.rootViewController is NCMainTabBarController { + self.dismiss(animated: true) + } else { + if let controller = UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController() as? NCMainTabBarController { + controller.modalPresentationStyle = .fullScreen + controller.view.alpha = 0 + window?.rootViewController = controller + window?.makeKeyAndVisible() + UIView.animate(withDuration: 0.5) { + controller.view.alpha = 1 + } + } + } + } else { + let alertController = UIAlertController(title: NSLocalizedString("_error_", comment: ""), message: error.errorDescription, preferredStyle: .alert) + alertController.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default, handler: { _ in })) + self.present(alertController, animated: true) + } + } } } } @@ -159,42 +179,4 @@ extension NCLoginProvider: WKNavigationDelegate { func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { NCActivityIndicator.shared.stop() } - - // MARK: - - - func createAccount(server: String, username: String, password: String) { - var urlBase = server - if urlBase.last == "/" { urlBase = String(urlBase.dropLast()) } - let account: String = "\(username) \(urlBase)" - let user = username - - NextcloudKit.shared.setup(account: account, user: user, userId: user, password: password, urlBase: urlBase, groupIdentifier: NCBrandOptions.shared.capabilitiesGroup) - NextcloudKit.shared.getUserProfile { _, userProfile, _, error in - if error == .success, let userProfile { - NCManageDatabase.shared.deleteAccount(account) - NCManageDatabase.shared.addAccount(account, urlBase: urlBase, user: user, userId: userProfile.userId, password: password) - - self.appDelegate.changeAccount(account, userProfile: userProfile) - - let window = UIApplication.shared.firstWindow - if window?.rootViewController is NCMainTabBarController { - self.dismiss(animated: true) - } else { - if let controller = UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController() as? NCMainTabBarController { - controller.modalPresentationStyle = .fullScreen - controller.view.alpha = 0 - window?.rootViewController = controller - window?.makeKeyAndVisible() - UIView.animate(withDuration: 0.5) { - controller.view.alpha = 1 - } - } - } - } else { - let alertController = UIAlertController(title: NSLocalizedString("_error_", comment: ""), message: error.errorDescription, preferredStyle: .alert) - alertController.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default, handler: { _ in })) - self.present(alertController, animated: true) - } - } - } } From 0be67e9316826b0b23c7260c3adbc63192a80d0e Mon Sep 17 00:00:00 2001 From: Marino Faggiana Date: Sat, 20 Jul 2024 13:19:45 +0200 Subject: [PATCH 2/7] cleaning Signed-off-by: Marino Faggiana --- iOSClient/AppDelegate.swift | 4 +++- iOSClient/Login/NCLoginPoll.swift | 14 +++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/iOSClient/AppDelegate.swift b/iOSClient/AppDelegate.swift index a11213e280..d0131534ac 100644 --- a/iOSClient/AppDelegate.swift +++ b/iOSClient/AppDelegate.swift @@ -471,7 +471,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD NextcloudKit.shared.getUserProfile(url: url, user: user, password: password, userAgent: userAgent) { userProfile, _, error in if error == .success, let userProfile { var urlBase = url - if urlBase.last == "/" { urlBase = String(urlBase.dropLast()) } + if urlBase.last == "/" { + urlBase = String(urlBase.dropLast()) + } let account: String = "\(userProfile.userId)@\(urlBase)" /// OLD account compatibility remove account diff --git a/iOSClient/Login/NCLoginPoll.swift b/iOSClient/Login/NCLoginPoll.swift index cdd95a7dba..40646e8da8 100644 --- a/iOSClient/Login/NCLoginPoll.swift +++ b/iOSClient/Login/NCLoginPoll.swift @@ -127,7 +127,11 @@ private class LoginManager: ObservableObject { NextcloudKit.shared.getLoginFlowV2Poll(token: self.loginFlowV2Token, endpoint: self.loginFlowV2Endpoint) { server, loginName, appPassword, _, error in if error == .success, let server, let loginName, let appPassword { self.isLoading = true - self.createAccount(server: server, username: loginName, password: appPassword) + self.appDelegate.createAccount(url: server, user: loginName, password: appPassword) { error in + if error == .success { + self.pollFinished = true + } + } } } } @@ -135,12 +139,4 @@ private class LoginManager: ObservableObject { func openLoginInBrowser() { UIApplication.shared.open(URL(string: loginFlowV2Login)!) } - - private func createAccount(server: String, username: String, password: String) { - appDelegate.createAccount(url: server, user: username, password: password) { error in - if error == .success { - self.pollFinished = true - } - } - } } From c1884ab132ba39b90cde6dafa73631acfaf6c5ec Mon Sep 17 00:00:00 2001 From: Marino Faggiana Date: Sun, 21 Jul 2024 14:36:15 +0200 Subject: [PATCH 3/7] coding Signed-off-by: Marino Faggiana --- iOSClient/AppDelegate.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/iOSClient/AppDelegate.swift b/iOSClient/AppDelegate.swift index d0131534ac..6d6656e1e4 100644 --- a/iOSClient/AppDelegate.swift +++ b/iOSClient/AppDelegate.swift @@ -474,12 +474,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD if urlBase.last == "/" { urlBase = String(urlBase.dropLast()) } - let account: String = "\(userProfile.userId)@\(urlBase)" - - /// OLD account compatibility remove account let oldAccount: String = "\(user) \(urlBase)" - NCManageDatabase.shared.deleteAccount(oldAccount) - /// + var account: String = "\(user)@\(urlBase)" + if let accounts = NCManageDatabase.shared.getAccounts(), + accounts.contains(oldAccount) { + account = oldAccount + } NCManageDatabase.shared.deleteAccount(account) NCManageDatabase.shared.addAccount(account, urlBase: urlBase, user: user, userId: userProfile.userId, password: password) From 75882cbc86729fb1e1d9d6e73cd9947decddad3e Mon Sep 17 00:00:00 2001 From: Marino Faggiana Date: Sun, 21 Jul 2024 14:44:39 +0200 Subject: [PATCH 4/7] cod Signed-off-by: Marino Faggiana --- .../FileProviderData.swift | 2 -- iOSClient/AppDelegate.swift | 27 +++++++++---------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/File Provider Extension/FileProviderData.swift b/File Provider Extension/FileProviderData.swift index a05552d340..bc271a4649 100644 --- a/File Provider Extension/FileProviderData.swift +++ b/File Provider Extension/FileProviderData.swift @@ -76,7 +76,6 @@ class fileProviderData: NSObject { // NO DOMAIN -> Set default account if domain == nil { guard let activeAccount = NCManageDatabase.shared.getActiveAccount() else { return nil } - account = activeAccount.account user = activeAccount.user userId = activeAccount.userId @@ -99,7 +98,6 @@ class fileProviderData: NSObject { guard let host = url.host else { continue } let accountDomain = activeAccount.userId + " (" + host + ")" if accountDomain == domain!.identifier.rawValue { - account = activeAccount.account user = activeAccount.user userId = activeAccount.userId diff --git a/iOSClient/AppDelegate.swift b/iOSClient/AppDelegate.swift index 6d6656e1e4..5b2a305642 100644 --- a/iOSClient/AppDelegate.swift +++ b/iOSClient/AppDelegate.swift @@ -468,24 +468,23 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD user: String, password: String, completion: @escaping (_ error: NKError) -> Void) { - NextcloudKit.shared.getUserProfile(url: url, user: user, password: password, userAgent: userAgent) { userProfile, _, error in - if error == .success, let userProfile { - var urlBase = url - if urlBase.last == "/" { - urlBase = String(urlBase.dropLast()) - } - let oldAccount: String = "\(user) \(urlBase)" - var account: String = "\(user)@\(urlBase)" - if let accounts = NCManageDatabase.shared.getAccounts(), - accounts.contains(oldAccount) { - account = oldAccount - } + var urlBase = url + if urlBase.last == "/" { + urlBase = String(urlBase.dropLast()) + } + let oldAccount: String = "\(user) \(urlBase)" + var account: String = "\(user)@\(urlBase)" + if let accounts = NCManageDatabase.shared.getAccounts(), + accounts.contains(oldAccount) { + account = oldAccount + } + NextcloudKit.shared.setup(account: account, user: user, userId: user, password: password, urlBase: urlBase) + NextcloudKit.shared.getUserProfile { _, userProfile, _, error in + if error == .success, let userProfile { NCManageDatabase.shared.deleteAccount(account) NCManageDatabase.shared.addAccount(account, urlBase: urlBase, user: user, userId: userProfile.userId, password: password) - NCKeychain().setClientCertificate(account: account, p12Data: NCNetworking.shared.p12Data, p12Password: NCNetworking.shared.p12Password) - self.changeAccount(account, userProfile: userProfile) } else { let alertController = UIAlertController(title: NSLocalizedString("_error_", comment: ""), message: error.errorDescription, preferredStyle: .alert) From 05bebe996a10166e0dfa345595e8b1dfc52226de Mon Sep 17 00:00:00 2001 From: Marino Faggiana Date: Sun, 21 Jul 2024 15:27:21 +0200 Subject: [PATCH 5/7] cleaning Signed-off-by: Marino Faggiana --- iOSClient/AppDelegate.swift | 4 +++- iOSClient/Login/NCLogin.swift | 3 --- iOSClient/Login/NCLoginQRCode.swift | 3 --- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/iOSClient/AppDelegate.swift b/iOSClient/AppDelegate.swift index 5b2a305642..24ac480fdf 100644 --- a/iOSClient/AppDelegate.swift +++ b/iOSClient/AppDelegate.swift @@ -501,7 +501,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD NCNetworking.shared.cancelDownloadTasks() NCNetworking.shared.cancelUploadTasks() - guard let tableAccount = NCManageDatabase.shared.setAccountActive(account) else { return } + guard let tableAccount = NCManageDatabase.shared.setAccountActive(account) else { + return + } if account != self.account { DispatchQueue.global().async { diff --git a/iOSClient/Login/NCLogin.swift b/iOSClient/Login/NCLogin.swift index 9ba5b3d031..b2fced42f3 100644 --- a/iOSClient/Login/NCLogin.swift +++ b/iOSClient/Login/NCLogin.swift @@ -28,7 +28,6 @@ import SwiftEntryKit import SwiftUI class NCLogin: UIViewController, UITextFieldDelegate, NCLoginQRCodeDelegate { - @IBOutlet weak var imageBrand: UIImageView! @IBOutlet weak var imageBrandConstraintY: NSLayoutConstraint! @IBOutlet weak var baseUrl: UITextField! @@ -408,9 +407,7 @@ class NCLogin: UIViewController, UITextFieldDelegate, NCLoginQRCodeDelegate { let password = valueArray[1].replacingOccurrences(of: "password:", with: "") let urlBase = valueArray[2].replacingOccurrences(of: "server:", with: "") let serverUrl = urlBase + "/" + NextcloudKit.shared.nkCommonInstance.dav - loginButton.isEnabled = false - NextcloudKit.shared.checkServer(serverUrl: serverUrl) { error in self.loginButton.isEnabled = true self.standardLogin(url: urlBase, user: user, password: password, error: error) diff --git a/iOSClient/Login/NCLoginQRCode.swift b/iOSClient/Login/NCLoginQRCode.swift index 1c80918c7f..6ef2805d9b 100644 --- a/iOSClient/Login/NCLoginQRCode.swift +++ b/iOSClient/Login/NCLoginQRCode.swift @@ -59,7 +59,6 @@ class NCLoginQRCode: NSObject, QRCodeReaderViewControllerDelegate { readerVC.completionBlock = { (_: QRCodeReaderResult?) in self.readerVC.dismiss(animated: true, completion: nil) } - delegate?.present(readerVC, animated: true, completion: nil) } @@ -72,7 +71,6 @@ class NCLoginQRCode: NSObject, QRCodeReaderViewControllerDelegate { switch error.code { case -11852: alert = UIAlertController(title: NSLocalizedString("_error_", comment: ""), message: NSLocalizedString("_qrcode_not_authorized_", comment: ""), preferredStyle: .alert) - alert.addAction(UIAlertAction(title: NSLocalizedString("_settings_", comment: ""), style: .default, handler: { _ in DispatchQueue.main.async { if let settingsURL = URL(string: UIApplication.openSettingsURLString) { @@ -88,7 +86,6 @@ class NCLoginQRCode: NSObject, QRCodeReaderViewControllerDelegate { } delegate?.present(alert, animated: true, completion: nil) - return false } } From 35d932ea2f531d623d434130978ccf3cbd005b13 Mon Sep 17 00:00:00 2001 From: Marino Faggiana Date: Sun, 21 Jul 2024 15:28:38 +0200 Subject: [PATCH 6/7] cod Signed-off-by: Marino Faggiana --- iOSClient/AppDelegate.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/iOSClient/AppDelegate.swift b/iOSClient/AppDelegate.swift index 24ac480fdf..8de435b3ec 100644 --- a/iOSClient/AppDelegate.swift +++ b/iOSClient/AppDelegate.swift @@ -496,15 +496,15 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD } func changeAccount(_ account: String, userProfile: NKUserProfile?) { + guard let tableAccount = NCManageDatabase.shared.setAccountActive(account) else { + return + } + NCNetworking.shared.cancelAllQueue() NCNetworking.shared.cancelDataTask() NCNetworking.shared.cancelDownloadTasks() NCNetworking.shared.cancelUploadTasks() - guard let tableAccount = NCManageDatabase.shared.setAccountActive(account) else { - return - } - if account != self.account { DispatchQueue.global().async { if NCManageDatabase.shared.getAccounts()?.count == 1 { From 505ef44a7a8c59c1117bd224dca64e9fa9927e56 Mon Sep 17 00:00:00 2001 From: Marino Faggiana Date: Sun, 21 Jul 2024 15:33:22 +0200 Subject: [PATCH 7/7] cod Signed-off-by: Marino Faggiana --- Tests/NextcloudIntegrationTests/FilesIntegrationTests.swift | 2 +- iOSClient/AppDelegate.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/NextcloudIntegrationTests/FilesIntegrationTests.swift b/Tests/NextcloudIntegrationTests/FilesIntegrationTests.swift index cb049761f4..f538479081 100644 --- a/Tests/NextcloudIntegrationTests/FilesIntegrationTests.swift +++ b/Tests/NextcloudIntegrationTests/FilesIntegrationTests.swift @@ -37,7 +37,7 @@ final class FilesIntegrationTests: BaseIntegrationXCTestCase { let serverUrl = "\(TestConstants.server)/remote.php/dav/files/\(TestConstants.username)" let serverUrlFileName = "\(serverUrl)/\(folderName)" - NextcloudKit.shared.setup(account: TestConstants.account, user: TestConstants.username, userId: TestConstants.username, password: appToken, urlBase: TestConstants.server) + NextcloudKit.shared.setup(account: TestConstants.account, user: TestConstants.username, userId: TestConstants.username, password: appToken, urlBase: TestConstants.server, groupIdentifier: NCBrandOptions.shared.capabilitiesGroup) // Test creating folder NCNetworking.shared.createFolder(fileName: folderName, serverUrl: serverUrl, account: TestConstants.account, urlBase: TestConstants.server, userId: TestConstants.username, withPush: true, sceneIdentifier: nil) { error in diff --git a/iOSClient/AppDelegate.swift b/iOSClient/AppDelegate.swift index 8de435b3ec..73e4333534 100644 --- a/iOSClient/AppDelegate.swift +++ b/iOSClient/AppDelegate.swift @@ -479,7 +479,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD account = oldAccount } - NextcloudKit.shared.setup(account: account, user: user, userId: user, password: password, urlBase: urlBase) + NextcloudKit.shared.setup(account: account, user: user, userId: user, password: password, urlBase: urlBase, groupIdentifier: NCBrandOptions.shared.capabilitiesGroup) NextcloudKit.shared.getUserProfile { _, userProfile, _, error in if error == .success, let userProfile { NCManageDatabase.shared.deleteAccount(account)