Add support for account deactivation when not using OIDC. (#3295)

This commit is contained in:
Doug
2024-09-17 20:08:35 +01:00
committed by GitHub
parent 8660a22b3e
commit 5625e78fc9
41 changed files with 822 additions and 35 deletions
@@ -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,