mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 23:32:41 +00:00
Force non-cancellable session verification when needed (account migration / interrupted authentication)
This commit is contained in:
parent
082cc520fe
commit
088ddd4972
3 changed files with 12 additions and 2 deletions
|
@ -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];
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue