Can set recovery key of user

This commit is contained in:
2025-11-10 08:47:02 +01:00
parent 4a72411d65
commit a23d671376
4 changed files with 32 additions and 1 deletions

View File

@@ -43,3 +43,17 @@ pub async fn logout(
Ok(HttpResponse::Ok().finish())
}
#[derive(serde::Deserialize)]
struct SetRecoveryKeyRequest {
key: String,
}
/// Set recovery key of user
pub async fn set_recovery_key(client: MatrixClientExtractor) -> HttpResult {
let key = client.auth.decode_json_body::<SetRecoveryKeyRequest>()?.key;
client.client.set_recovery_key(&key).await?;
Ok(HttpResponse::Accepted().finish())
}