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:
Doug
2023-08-30 09:22:22 +01:00
committed by GitHub
parent 220279fd28
commit a5045e1598
6 changed files with 29 additions and 15 deletions
@@ -397,19 +397,25 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationCoordinatorDelegate,
}
Task {
// first log out from the server
_ = await userSession.clientProxy.logout()
// First log out from the server
let accountLogoutURL = await userSession.clientProxy.logout()
// regardless of the result, clear user data
// Regardless of the result, clear user data
userSessionStore.logout(userSession: userSession)
tearDownUserSession()
// reset analytics
// Reset analytics
ServiceLocator.shared.analytics.optOut()
ServiceLocator.shared.analytics.resetConsentState()
stateMachine.processEvent(.completedSigningOut(isSoft: isSoft))
// Handle OIDC's RP-Initiated Logout if needed. Don't fallback to an ASWebAuthenticationSession
// as it looks weird to show an alert to the user asking them to sign in to their provider.
if let accountLogoutURL, UIApplication.shared.canOpenURL(accountLogoutURL) {
await UIApplication.shared.open(accountLogoutURL)
}
hideLoadingIndicator()
}
}