mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +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:
@@ -32,19 +32,14 @@ final class NSEUserSession {
|
||||
}
|
||||
|
||||
let homeserverURL = credentials.restorationToken.session.homeserverUrl
|
||||
var clientBuilder = ClientBuilder()
|
||||
let clientBuilder = ClientBuilder
|
||||
.baseBuilder(setupEncryption: false,
|
||||
httpProxy: URL(string: homeserverURL)?.globalProxy,
|
||||
sessionDelegate: clientSessionDelegate)
|
||||
.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: clientSessionDelegate)
|
||||
|
||||
if let homeserverURL = URL(string: homeserverURL),
|
||||
let proxy = homeserverURL.globalProxy {
|
||||
clientBuilder = clientBuilder.proxy(url: proxy)
|
||||
}
|
||||
|
||||
baseClient = try await clientBuilder.build()
|
||||
delegateHandle = baseClient.setDelegate(delegate: ClientDelegateWrapper())
|
||||
|
||||
@@ -77,6 +77,7 @@ targets:
|
||||
- path: ../../ElementX/Sources/Other/AvatarSize.swift
|
||||
- path: ../../ElementX/Sources/Other/Extensions/AttributedString.swift
|
||||
- path: ../../ElementX/Sources/Other/Extensions/Bundle.swift
|
||||
- path: ../../ElementX/Sources/Other/Extensions/ClientBuilder.swift
|
||||
- path: ../../ElementX/Sources/Other/Extensions/Date.swift
|
||||
- path: ../../ElementX/Sources/Other/Extensions/FileManager.swift
|
||||
- path: ../../ElementX/Sources/Other/Extensions/ImageCache.swift
|
||||
|
||||
Reference in New Issue
Block a user