From d182202c787b8d536726b0baae78d36df0cc5984 Mon Sep 17 00:00:00 2001 From: Doug <6060466+pixlwave@users.noreply.github.com> Date: Tue, 5 Sep 2023 17:54:15 +0100 Subject: [PATCH] Always use WAS for the account URL page. (#1634) --- .../SettingsScreenCoordinator.swift | 17 ++++------------- changelog.d/pr-1634.change | 1 + 2 files changed, 5 insertions(+), 13 deletions(-) create mode 100644 changelog.d/pr-1634.change diff --git a/ElementX/Sources/Screens/Settings/SettingsScreen/SettingsScreenCoordinator.swift b/ElementX/Sources/Screens/Settings/SettingsScreen/SettingsScreenCoordinator.swift index d0bc22467..7100dd620 100644 --- a/ElementX/Sources/Screens/Settings/SettingsScreen/SettingsScreenCoordinator.swift +++ b/ElementX/Sources/Screens/Settings/SettingsScreen/SettingsScreenCoordinator.swift @@ -89,19 +89,10 @@ final class SettingsScreenCoordinator: CoordinatorProtocol { return } - #if targetEnvironment(simulator) - let canOpenURL = false // Safari can't access the cookie on the iOS 16 simulator 🤷‍♂️ - #else - let canOpenURL = UIApplication.shared.canOpenURL(accountURL) - #endif - - if canOpenURL { - UIApplication.shared.open(accountURL) - } else { - // Fall back to an ASWebAuthenticationSession to handle the URL inside the app. - accountSettingsPresenter = OIDCAccountSettingsPresenter(accountURL: accountURL, presentationAnchor: window) - accountSettingsPresenter?.start() - } + // Note to anyone in the future if you come back here to make this open in Safari instead of a WAS. + // As of iOS 16, there is an issue on the simulator with accessing the cookie but it works on a device. 🤷‍♂️ + accountSettingsPresenter = OIDCAccountSettingsPresenter(accountURL: accountURL, presentationAnchor: window) + accountSettingsPresenter?.start() } private func presentAnalyticsScreen() { diff --git a/changelog.d/pr-1634.change b/changelog.d/pr-1634.change new file mode 100644 index 000000000..6058c4869 --- /dev/null +++ b/changelog.d/pr-1634.change @@ -0,0 +1 @@ +Revert to using a Web Authentication Session for OIDC account management. \ No newline at end of file