mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-17 15:09:31 +02:00
Merge pull request #7657 from vector-im/mauroromito/mas_device_logout
Open MAS Web page when logging out from other sessions on OIDC authenticated homeservers
This commit is contained in:
@@ -655,6 +655,20 @@ enum {
|
||||
}
|
||||
|
||||
- (void)removeDevice
|
||||
{
|
||||
NSURL *logoutURL = [self.mainSession.homeserverWellknown.authentication getLogoutDeviceURLFromID:device.deviceId];
|
||||
if (logoutURL)
|
||||
{
|
||||
[UIApplication.sharedApplication openURL:logoutURL options:@{} completionHandler:nil];
|
||||
[self withdrawViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self removeDeviceThroughAPI];
|
||||
}
|
||||
}
|
||||
|
||||
-(void) removeDeviceThroughAPI
|
||||
{
|
||||
[self startActivityIndicator];
|
||||
self.view.userInteractionEnabled = NO;
|
||||
|
||||
@@ -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?.getLogoutDeviceURL(fromID: 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.
|
||||
|
||||
1
changelog.d/7646.bugfix
Normal file
1
changelog.d/7646.bugfix
Normal file
@@ -0,0 +1 @@
|
||||
You can now log out from other sessions using MAS on supported OIDC home servers.
|
||||
Reference in New Issue
Block a user