Add AuthenticationRestClient protocol as an authentication interface to MXRestClient.

This commit is contained in:
Doug
2022-05-19 13:18:47 +01:00
committed by Doug
parent ac755f11f5
commit 59927e278c
9 changed files with 70 additions and 26 deletions
@@ -30,7 +30,7 @@ class AuthenticationService: NSObject {
// MARK: Private
/// The rest client used to make authentication requests.
private var client: MXRestClient
private var client: AuthenticationRestClient
/// The object used to create a new `MXSession` when authentication has completed.
private var sessionCreator = SessionCreator()
@@ -141,7 +141,7 @@ class AuthenticationService: NSObject {
let address = state.homeserver.addressFromUser ?? state.homeserver.address
self.state = AuthenticationState(flow: .login, homeserverAddress: address)
}
/// Create a session after a SSO successful login
func makeSessionFromSSO(credentials: MXCredentials) -> MXSession {
sessionCreator.createSession(credentials: credentials, client: client)