mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-24 02:22:44 +02:00
KeyVerificationCoordinator: Handle secrets recovery flow from complete security.
This commit is contained in:
@@ -173,6 +173,17 @@ final class KeyVerificationCoordinator: KeyVerificationCoordinatorType {
|
||||
return coordinator
|
||||
}
|
||||
|
||||
private func showSecretsRecovery(with recoveryMode: SecretsRecoveryMode) {
|
||||
let coordinator = SecretsRecoveryCoordinator(session: self.session, recoveryMode: recoveryMode, navigationRouter: self.navigationRouter)
|
||||
coordinator.delegate = self
|
||||
coordinator.start()
|
||||
|
||||
self.add(childCoordinator: coordinator)
|
||||
self.navigationRouter.setRootModule(coordinator) { [weak self] in
|
||||
self?.remove(childCoordinator: coordinator)
|
||||
}
|
||||
}
|
||||
|
||||
private func createSelfVerificationCoordinator(otherDeviceId: String) -> KeyVerificationSelfVerifyStartCoordinator {
|
||||
let coordinator = KeyVerificationSelfVerifyStartCoordinator(session: self.session, otherDeviceId: otherDeviceId)
|
||||
coordinator.delegate = self
|
||||
@@ -412,6 +423,10 @@ extension KeyVerificationCoordinator: KeyVerificationSelfVerifyWaitCoordinatorDe
|
||||
func keyVerificationSelfVerifyWaitCoordinatorDidCancel(_ coordinator: KeyVerificationSelfVerifyWaitCoordinatorType) {
|
||||
self.didCancel()
|
||||
}
|
||||
|
||||
func keyVerificationSelfVerifyWaitCoordinator(_ coordinator: KeyVerificationSelfVerifyWaitCoordinatorType, wantsToRecoverSecretsWith secretsRecoveryMode: SecretsRecoveryMode) {
|
||||
self.showSecretsRecovery(with: secretsRecoveryMode)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - KeyVerificationScanConfirmationCoordinatorDelegate
|
||||
@@ -425,3 +440,15 @@ extension KeyVerificationCoordinator: KeyVerificationScanConfirmationCoordinator
|
||||
self.didCancel()
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - SecretsRecoveryCoordinatorDelegate
|
||||
extension KeyVerificationCoordinator: SecretsRecoveryCoordinatorDelegate {
|
||||
|
||||
func secretsRecoveryCoordinatorDidRecover(_ coordinator: SecretsRecoveryCoordinatorType) {
|
||||
self.showVerified(animated: true)
|
||||
}
|
||||
|
||||
func secretsRecoveryCoordinatorDidCancel(_ coordinator: SecretsRecoveryCoordinatorType) {
|
||||
self.didCancel()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user