mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Use a Client in AuthenticationService now that the Rust one has been removed. (#2954)
* Replace Rust's Authentication service by building a Client. * Drop the Proxy from AuthenticationServiceProxy[Protocol]. * Make sure to call abortOIDCLogin. * Centralise common ClientBuilder code. * Update the SDK.
This commit is contained in:
@@ -118,24 +118,16 @@ class UserSessionStore: UserSessionStoreProtocol {
|
||||
|
||||
let homeserverURL = credentials.restorationToken.session.homeserverUrl
|
||||
|
||||
var builder = ClientBuilder()
|
||||
let builder = ClientBuilder
|
||||
.baseBuilder(httpProxy: URL(string: homeserverURL)?.globalProxy,
|
||||
sessionDelegate: keychainController)
|
||||
.sessionPath(path: credentials.restorationToken.sessionDirectory.path(percentEncoded: false))
|
||||
.username(username: credentials.userID)
|
||||
.homeserverUrl(url: homeserverURL)
|
||||
.passphrase(passphrase: credentials.restorationToken.passphrase)
|
||||
.userAgent(userAgent: UserAgentBuilder.makeASCIIUserAgent())
|
||||
.enableCrossProcessRefreshLock(processId: InfoPlistReader.main.bundleIdentifier,
|
||||
sessionDelegate: keychainController)
|
||||
.serverVersions(versions: ["v1.0", "v1.1", "v1.2", "v1.3", "v1.4", "v1.5"]) // FIXME: Quick and dirty fix for stopping version requests on startup https://github.com/matrix-org/matrix-rust-sdk/pull/1376
|
||||
|
||||
if let homeserverURL = URL(string: homeserverURL),
|
||||
let proxy = homeserverURL.globalProxy {
|
||||
builder = builder.proxy(url: proxy)
|
||||
}
|
||||
let completeBuilder = builder
|
||||
|
||||
do {
|
||||
let client = try await completeBuilder.build()
|
||||
let client = try await builder.build()
|
||||
|
||||
try await client.restoreSession(session: credentials.restorationToken.session)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user