mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Add support for account deactivation when not using OIDC. (#3295)
This commit is contained in:
@@ -213,6 +213,10 @@ class ClientProxy: ClientProxyProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
var canDeactivateAccount: Bool {
|
||||
client.canDeactivateAccount()
|
||||
}
|
||||
|
||||
var userIDServerName: String? {
|
||||
do {
|
||||
return try client.userIdServerName()
|
||||
@@ -546,6 +550,16 @@ class ClientProxy: ClientProxyProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
func deactivateAccount(password: String?, eraseData: Bool) async -> Result<Void, ClientProxyError> {
|
||||
do {
|
||||
try await client.deactivateAccount(authData: password.map { .password(passwordDetails: .init(identifier: userID, password: $0)) },
|
||||
eraseData: eraseData)
|
||||
return .success(())
|
||||
} catch {
|
||||
return .failure(.sdkError(error))
|
||||
}
|
||||
}
|
||||
|
||||
func setPusher(with configuration: PusherConfiguration) async throws {
|
||||
try await client.setPusher(identifiers: configuration.identifiers,
|
||||
kind: configuration.kind,
|
||||
|
||||
@@ -99,6 +99,8 @@ protocol ClientProxyProtocol: AnyObject, MediaLoaderProtocol {
|
||||
var slidingSyncVersion: SlidingSyncVersion { get }
|
||||
var availableSlidingSyncVersions: [SlidingSyncVersion] { get async }
|
||||
|
||||
var canDeactivateAccount: Bool { get }
|
||||
|
||||
var userIDServerName: String? { get }
|
||||
|
||||
var userDisplayNamePublisher: CurrentValuePublisher<String?, Never> { get }
|
||||
@@ -157,6 +159,8 @@ protocol ClientProxyProtocol: AnyObject, MediaLoaderProtocol {
|
||||
|
||||
func sessionVerificationControllerProxy() async -> Result<SessionVerificationControllerProxyProtocol, ClientProxyError>
|
||||
|
||||
func deactivateAccount(password: String?, eraseData: Bool) async -> Result<Void, ClientProxyError>
|
||||
|
||||
func logout() async -> URL?
|
||||
|
||||
func setPusher(with configuration: PusherConfiguration) async throws
|
||||
|
||||
Reference in New Issue
Block a user