This commit is contained in:
Mauro Romito
2023-08-25 17:22:11 +02:00
parent 070acd436f
commit 2b93d8f03a
3 changed files with 25 additions and 1 deletions
@@ -123,7 +123,11 @@ final class UserSessionsFlowCoordinator: NSObject, Coordinator, Presentable {
if sessionInfo.isCurrent {
self.showLogoutConfirmationForCurrentSession()
} else {
self.showLogoutConfirmation(for: [sessionInfo])
if let logoutURL = self.parameters.session.homeserverWellknown.authentication?.getMasLogoutDeviceURL(fromDeviceID: sessionInfo.id) {
self.openMasLogoutURL(logoutURL)
} else {
self.showLogoutConfirmation(for: [sessionInfo])
}
}
case let .showSessionStateInfo(sessionInfo):
self.showInfoSheet(parameters: .init(userSessionInfo: sessionInfo, parentSize: self.toPresentable().view.bounds.size))
@@ -182,6 +186,11 @@ final class UserSessionsFlowCoordinator: NSObject, Coordinator, Presentable {
return UserOtherSessionsCoordinator(parameters: parameters)
}
private func openMasLogoutURL(_ url: URL) {
UIApplication.shared.open(url)
popToSessionsOverview()
}
/// Shows a confirmation dialog to the user to sign out of a session.
private func showLogoutConfirmation(for sessionInfos: [UserSessionInfo]) {
// Use a UIAlertController as we don't have confirmationDialog in SwiftUI on iOS 14.