Enable OIDC support (#1541)

Notification content is bypassed for now.
This commit is contained in:
Doug
2023-08-22 15:53:27 +01:00
committed by GitHub
parent d633b87609
commit 5e3a32157a
27 changed files with 239 additions and 70 deletions
@@ -108,6 +108,10 @@ class ClientProxy: ClientProxyProtocol {
return nil
}
}
var accountURL: URL? {
client.accountUrl().flatMap(URL.init(string:))
}
func startSync() {
MXLog.info("Starting sync")
@@ -305,7 +309,8 @@ class ClientProxy: ClientProxyProtocol {
func logout() async {
await Task.dispatch(on: clientQueue) {
do {
try self.client.logout()
// We aren't currently handling the RP initiated sign out URL.
_ = try self.client.logout()
} catch {
MXLog.error("Failed logging out with error: \(error)")
}
@@ -76,6 +76,8 @@ protocol ClientProxyProtocol: AnyObject, MediaLoaderProtocol {
var restorationToken: RestorationToken? { get }
var accountURL: URL? { get }
var roomSummaryProvider: RoomSummaryProviderProtocol? { get }
var inviteSummaryProvider: RoomSummaryProviderProtocol? { get }
@@ -25,6 +25,7 @@ class MockClientProxy: ClientProxyProtocol {
let deviceID: String?
let homeserver = ""
let restorationToken: RestorationToken? = nil
let accountURL: URL?
var roomSummaryProvider: RoomSummaryProviderProtocol? = MockRoomSummaryProvider()
@@ -32,9 +33,10 @@ class MockClientProxy: ClientProxyProtocol {
var avatarURLPublisher: AnyPublisher<URL?, Never> { Empty().eraseToAnyPublisher() }
init(userID: String, deviceID: String? = nil, roomSummaryProvider: RoomSummaryProviderProtocol? = MockRoomSummaryProvider()) {
init(userID: String, deviceID: String? = nil, accountURL: URL? = nil, roomSummaryProvider: RoomSummaryProviderProtocol? = MockRoomSummaryProvider()) {
self.userID = userID
self.deviceID = deviceID
self.accountURL = accountURL
self.roomSummaryProvider = roomSummaryProvider
}