Address PR comments.

Log errors before throwing.
Remove white colour.
Remove AuthenticationCoordinatorState added during rebase.
This commit is contained in:
Doug
2022-05-03 10:55:43 +01:00
committed by Doug
parent 95d1a2a39e
commit 33eb847ba3
10 changed files with 18 additions and 52 deletions
@@ -178,6 +178,7 @@ class AuthenticationService: NSObject {
let homeserverAddress = HomeserverAddress.sanitized(homeserverAddress)
guard var homeserverURL = URL(string: homeserverAddress) else {
MXLog.error("[AuthenticationService] Unable to create a URL from the supplied homeserver address when calling loginFlow.")
throw AuthenticationError.invalidHomeserver
}
@@ -203,7 +204,10 @@ class AuthenticationService: NSObject {
/// This method is used to get the flows for a server after a soft-logout.
/// - Parameter session: The MXSession where a soft-logout has occurred.
private func loginFlow(for session: MXSession) async throws -> LoginFlowResult {
guard let client = session.matrixRestClient else { throw AuthenticationError.missingMXRestClient }
guard let client = session.matrixRestClient else {
MXLog.error("[AuthenticationService] loginFlow called on a session that doesn't have a matrixRestClient.")
throw AuthenticationError.missingMXRestClient
}
let state = AuthenticationState(flow: .login, homeserverAddress: client.homeserver)
let loginFlow = try await getLoginFlowResult(client: session.matrixRestClient)