tuwunel_api/client/account/3pid/
delete_3pid.rs1use axum::extract::State;
2use ruma::api::client::account::{
3 ThirdPartyIdRemovalStatus,
4 delete_3pid::{self, v3::Response},
5};
6use tuwunel_core::Result;
7use tuwunel_service::threepid::canonicalize_email;
8
9use crate::Ruma;
10
11#[tracing::instrument(skip_all, name = "delete_3pid")]
19pub(crate) async fn delete_3pid_route(
20 State(services): State<crate::State>,
21 body: Ruma<delete_3pid::v3::Request>,
22) -> Result<Response> {
23 let sender_user = body.sender_user();
24
25 if let Ok(email_canon) = canonicalize_email(&body.address) {
26 services
27 .threepid
28 .del_binding(sender_user, &email_canon)
29 .await;
30 }
31
32 Ok(Response::new(ThirdPartyIdRemovalStatus::NoSupport))
33}