mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 08:32:53 +02:00
Security settings: Add an option to reset the secure backup
It will overwrite the existing one if any
This commit is contained in:
@@ -30,6 +30,7 @@ final class SecureBackupSetupCoordinator: SecureBackupSetupCoordinatorType {
|
||||
private let recoveryService: MXRecoveryService
|
||||
private let keyBackup: MXKeyBackup?
|
||||
private let checkKeyBackup: Bool
|
||||
private let allowOverwrite: Bool
|
||||
|
||||
// MARK: Public
|
||||
|
||||
@@ -45,11 +46,12 @@ final class SecureBackupSetupCoordinator: SecureBackupSetupCoordinatorType {
|
||||
/// - session: The MXSession.
|
||||
/// - checkKeyBackup: Indicate false to ignore existing key backup.
|
||||
/// - navigationRouter: Use existing navigation router to plug this flow or let nil to use new one.
|
||||
init(session: MXSession, checkKeyBackup: Bool = true, navigationRouter: NavigationRouterType? = nil) {
|
||||
init(session: MXSession, checkKeyBackup: Bool = true, allowOverwrite: Bool = false, navigationRouter: NavigationRouterType? = nil) {
|
||||
self.session = session
|
||||
self.recoveryService = session.crypto.recoveryService
|
||||
self.keyBackup = session.crypto.backup
|
||||
self.checkKeyBackup = checkKeyBackup
|
||||
self.allowOverwrite = allowOverwrite
|
||||
|
||||
if let navigationRouter = navigationRouter {
|
||||
self.navigationRouter = navigationRouter
|
||||
@@ -85,7 +87,7 @@ final class SecureBackupSetupCoordinator: SecureBackupSetupCoordinatorType {
|
||||
}
|
||||
|
||||
private func showSetupKey(passphraseOnly: Bool, passphrase: String? = nil) {
|
||||
let coordinator = SecretsSetupRecoveryKeyCoordinator(recoveryService: self.recoveryService, passphrase: passphrase, passphraseOnly: passphraseOnly)
|
||||
let coordinator = SecretsSetupRecoveryKeyCoordinator(recoveryService: self.recoveryService, passphrase: passphrase, passphraseOnly: passphraseOnly, allowOverwrite: allowOverwrite)
|
||||
coordinator.delegate = self
|
||||
coordinator.start()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user