diff --git a/Riot/Modules/Application/LegacyAppDelegate.m b/Riot/Modules/Application/LegacyAppDelegate.m index 09b41110e..70920ca97 100644 --- a/Riot/Modules/Application/LegacyAppDelegate.m +++ b/Riot/Modules/Application/LegacyAppDelegate.m @@ -4281,6 +4281,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni if (!keyVerificationCoordinatorBridgePresenter.isPresenting) { keyVerificationCoordinatorBridgePresenter = [[KeyVerificationCoordinatorBridgePresenter alloc] initWithSession:mxSession]; + keyVerificationCoordinatorBridgePresenter.cancellable = !mxSession.vc_homeserverConfiguration.encryption.isSecureBackupRequired; keyVerificationCoordinatorBridgePresenter.delegate = self; [keyVerificationCoordinatorBridgePresenter presentCompleteSecurityFrom:self.presentedViewController isNewSignIn:NO animated:YES]; diff --git a/Riot/Modules/Authentication/AuthenticationCoordinator.swift b/Riot/Modules/Authentication/AuthenticationCoordinator.swift index 6da92fc1c..708798844 100644 --- a/Riot/Modules/Authentication/AuthenticationCoordinator.swift +++ b/Riot/Modules/Authentication/AuthenticationCoordinator.swift @@ -117,7 +117,6 @@ final class AuthenticationCoordinator: NSObject, AuthenticationCoordinatorProtoc } private func presentCompleteSecurity() { - // TODO: handle secure backup required here guard let session = session else { MXLog.error("[AuthenticationCoordinator] presentCompleteSecurity: Unable to present security due to missing session.") authenticationDidComplete() @@ -125,7 +124,8 @@ final class AuthenticationCoordinator: NSObject, AuthenticationCoordinatorProtoc } let isNewSignIn = true - let keyVerificationCoordinator = KeyVerificationCoordinator(session: session, flow: .completeSecurity(isNewSignIn), cancellable: true) + let cancellable = !session.vc_homeserverConfiguration().encryption.isSecureBackupRequired + let keyVerificationCoordinator = KeyVerificationCoordinator(session: session, flow: .completeSecurity(isNewSignIn), cancellable: cancellable) keyVerificationCoordinator.delegate = self let presentable = keyVerificationCoordinator.toPresentable() diff --git a/Riot/Modules/TabBar/MasterTabBarController.m b/Riot/Modules/TabBar/MasterTabBarController.m index bc306b757..435f7ebcb 100644 --- a/Riot/Modules/TabBar/MasterTabBarController.m +++ b/Riot/Modules/TabBar/MasterTabBarController.m @@ -952,6 +952,15 @@ } self.reviewSessionAlertHasBeenDisplayed = YES; + + // Force verification if required by the HS configuration + if (session.vc_homeserverConfiguration.encryption.isSecureBackupRequired) + { + NSLog(@"[MasterTabBarController] presentVerifyCurrentSessionAlertIfNeededWithSession: Force verification of the device"); + [[AppDelegate theDelegate] presentCompleteSecurityForSession:session]; + return; + } + [self presentVerifyCurrentSessionAlertWithSession:session]; }