mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-26 19:34:25 +02:00
Feature/3811 appconfig
This commit is contained in:
@@ -144,7 +144,12 @@ final class AuthenticationCoordinator: NSObject, AuthenticationCoordinatorProtoc
|
||||
// bwi: force serverselection on test apps
|
||||
if (BWIBuildSettings.shared.authScreenShowTestServerOptions && BWIBuildSettings.shared.bwiLoginFlowLayout) ||
|
||||
BWIBuildSettings.shared.bumLoginFlowLayout {
|
||||
showServerSelectionScreen(for: flow)
|
||||
// bwi #3811: when there is a valid url from app config don't show server selection
|
||||
if BWIBuildSettings.shared.avoidServerSelectionOnAppConfig && AppConfigService.shared.isAppConfig {
|
||||
self.useHomeserver(AppConfigService.shared.serverUrl())
|
||||
} else {
|
||||
showServerSelectionScreen(for: flow)
|
||||
}
|
||||
} else {
|
||||
do {
|
||||
// Start the flow using the default server (or a provisioning link if set).
|
||||
@@ -267,6 +272,21 @@ final class AuthenticationCoordinator: NSObject, AuthenticationCoordinatorProtoc
|
||||
callback?(.cancel(.register))
|
||||
}
|
||||
|
||||
/// Updates the login flow using the supplied homeserver address, or shows an error when this isn't possible.
|
||||
@MainActor private func useHomeserver(_ homeserverAddress: String) {
|
||||
|
||||
let homeserverAddress = HomeserverAddress.sanitized(homeserverAddress)
|
||||
|
||||
Task {
|
||||
do {
|
||||
try await authenticationService.startFlow(.login, for: homeserverAddress)
|
||||
showLoginScreen()
|
||||
} catch {
|
||||
displayError(message: error.localizedDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Login
|
||||
|
||||
/// Shows the login screen.
|
||||
|
||||
@@ -189,7 +189,7 @@ final class OnboardingCoordinator: NSObject, OnboardingCoordinatorProtocol {
|
||||
}
|
||||
|
||||
private func showWelcomeExperience() {
|
||||
let welcomeVC = WelcomeExperienceViewController.makeViewController(completion: { [weak self] in
|
||||
let welcomeVC = WelcomeExperienceViewController.makeViewController(completion: { [weak self] in
|
||||
if BWIBuildSettings.shared.onboardingEnableNewAuthenticationFlow {
|
||||
self?.startLoading()
|
||||
self?.beginAuthentication(with: .login) { [weak self] in
|
||||
|
||||
Reference in New Issue
Block a user