swarm-controller: log matrix accounts in and out through swarm-matrix-client
Adds password_login and logout to swarm-matrix-client and deletes the controller's private copies, with their own timeouts and error text.
This commit is contained in:
parent
6f4b3562b7
commit
d7e48091ca
6 changed files with 300 additions and 179 deletions
|
|
@ -462,7 +462,11 @@ pub async fn delete_matrix_account(
|
|||
let revoke = query
|
||||
.revoke
|
||||
.then_some(|homeserver: String, token: String| async move {
|
||||
crate::matrix_account::matrix_logout(&homeserver, &token).await
|
||||
let http = swarm_matrix_client::client().map_err(|e| format!("{e:#}"))?;
|
||||
let base = homeserver.trim_end_matches('/');
|
||||
swarm_matrix_client::logout(&http, base, &token)
|
||||
.await
|
||||
.map_err(|e| format!("{e:#}"))
|
||||
});
|
||||
remove_matrix(&store, &path, revoke).await.map_err(|e| {
|
||||
tracing::warn!(%hive, %agent, %account, error = ?e, "deleting the matrix account failed");
|
||||
|
|
|
|||
Loading…
Reference in a new issue