MESSENGER-3707 new login flow and welcome integration

This commit is contained in:
Frank Rotermund
2022-11-30 18:10:20 +01:00
parent a37881ff16
commit 23021f6cbb
15 changed files with 172 additions and 41 deletions
@@ -220,6 +220,12 @@ class AuthenticationService: NSObject {
/// - Parameter homeserverAddress: The homeserver string entered by the user.
/// - Returns: A tuple containing the REST client for the server along with the homeserver state containing the login flows.
private func loginFlow(for homeserverAddress: String) async throws -> (AuthenticationRestClient, AuthenticationState.Homeserver) {
// bwi: we start with an empty url, element tries to load a wellknown from localhost for 15 seconds in that case
guard homeserverAddress.count > 0 else {
throw AuthenticationError.invalidHomeserver
}
let homeserverAddress = HomeserverAddress.sanitized(homeserverAddress)
guard var homeserverURL = URL(string: homeserverAddress) else {