From 44da96c55f4e6e84aa8e5e2c9af894c0c1923331 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Wed, 16 Mar 2022 15:09:33 +0200 Subject: [PATCH] Fixed login restoration on MacCatalyst. Added keychain access group entitlement. --- .../Sources/Screens/LoginScreen/LoginScreenViewModel.swift | 4 ++-- .../Sources/Services/Authentication/KeychainController.swift | 2 +- ElementX/Supporting Files/ElementX.entitlements | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ElementX/Sources/Screens/LoginScreen/LoginScreenViewModel.swift b/ElementX/Sources/Screens/LoginScreen/LoginScreenViewModel.swift index 0e9f99631..841f89295 100644 --- a/ElementX/Sources/Screens/LoginScreen/LoginScreenViewModel.swift +++ b/ElementX/Sources/Screens/LoginScreen/LoginScreenViewModel.swift @@ -34,8 +34,8 @@ class LoginScreenViewModel: LoginScreenViewModelType, LoginScreenViewModelProtoc // MARK: - Setup init() { - super.init(initialViewState: LoginScreenViewState(bindings: LoginScreenViewStateBindings(username: "@stefan.ceriu-element01:matrix.org", - password: "radeon"))) + super.init(initialViewState: LoginScreenViewState(bindings: LoginScreenViewStateBindings(username: "", + password: ""))) } // MARK: - Public diff --git a/ElementX/Sources/Services/Authentication/KeychainController.swift b/ElementX/Sources/Services/Authentication/KeychainController.swift index d0a2d34ad..66c9301ef 100644 --- a/ElementX/Sources/Services/Authentication/KeychainController.swift +++ b/ElementX/Sources/Services/Authentication/KeychainController.swift @@ -24,7 +24,7 @@ class KeychainController: KeychainControllerProtocol { do { try keychain.set(token, key: username) } catch { - MXLog.error("Failed storing user restore token") + MXLog.error("Failed storing user restore token with error: \(error)") } } diff --git a/ElementX/Supporting Files/ElementX.entitlements b/ElementX/Supporting Files/ElementX.entitlements index ee95ab7e5..7bee5583c 100644 --- a/ElementX/Supporting Files/ElementX.entitlements +++ b/ElementX/Supporting Files/ElementX.entitlements @@ -6,5 +6,9 @@ com.apple.security.network.client + keychain-access-groups + + $(AppIdentifierPrefix)io.element.elementx +