mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Use Safari for OIDC account URL. (#1591)
* Handle RP-Initiated Logout URL. Safari is only used on devices, the simulator doesn't work properly.
This commit is contained in:
@@ -88,12 +88,19 @@ final class SettingsScreenCoordinator: CoordinatorProtocol {
|
||||
return
|
||||
}
|
||||
|
||||
// Safari never works in the simulator, use a Web Authentication Session instead.
|
||||
accountSettingsPresenter = OIDCAccountSettingsPresenter(accountURL: accountURL, presentationAnchor: window)
|
||||
accountSettingsPresenter?.start()
|
||||
#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
|
||||
|
||||
// Safari isn't working with the shared browser session 😕
|
||||
// UIApplication.shared.open(accountURL)
|
||||
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()
|
||||
}
|
||||
}
|
||||
|
||||
private func presentAnalyticsScreen() {
|
||||
|
||||
Reference in New Issue
Block a user