Selecting a server that doesn't support login now fails instead of letting you continue to a failure later. (#3342)

* Fail configuration of the authentication service if the homeserver doesn't support login.

* Move the ServerSelectionCoordinator logic into the ViewModel.

- Handle the new login alert.
- Add more tests
This commit is contained in:
Doug
2024-09-27 13:58:05 +01:00
committed by GitHub
parent 8a3994016d
commit 17dfe1359a
17 changed files with 263 additions and 139 deletions
@@ -65,6 +65,9 @@ class AuthenticationService: AuthenticationServiceProtocol {
case .failure: nil
}
if flow == .login, homeserver.loginMode == .unsupported {
return .failure(.loginNotSupported)
}
if flow == .register, !homeserver.supportsRegistration {
return .failure(.registrationNotSupported)
}
@@ -24,6 +24,7 @@ enum AuthenticationServiceError: Error, Equatable {
case invalidHomeserverAddress
case invalidWellKnown(String)
case slidingSyncNotAvailable
case loginNotSupported
case registrationNotSupported
case accountDeactivated
case failedLoggingIn