diff --git a/src/api/client/account/mod.rs b/src/api/client/account/mod.rs index 3e450a46a..dad027c5b 100644 --- a/src/api/client/account/mod.rs +++ b/src/api/client/account/mod.rs @@ -154,7 +154,7 @@ pub(crate) async fn change_password_route( .await? } else { // A signed-out user is trying to reset their password, prompt them for email - // confirmation Note that we do not _send_ an email here, their client should + // confirmation. Note that we do not _send_ an email here, their client should // have already hit `/account/password/requestToken` to send the email. We // just validate it. @@ -337,7 +337,7 @@ pub(crate) async fn deactivate_route( } Ok(deactivate::v3::Response { - id_server_unbind_result: ThirdPartyIdRemovalStatus::NoSupport, + id_server_unbind_result: ThirdPartyIdRemovalStatus::Success, }) } @@ -373,6 +373,13 @@ pub async fn full_user_deactivate( ) -> Result<()> { services.users.deactivate_account(user_id).await.ok(); + if services.globals.user_is_local(user_id) { + let _ = services + .threepid + .disassociate_localpart_email(user_id.localpart()) + .await; + } + services .users .all_profile_keys(user_id) diff --git a/src/api/client/account/threepid.rs b/src/api/client/account/threepid.rs index 60b305493..b08f8246c 100644 --- a/src/api/client/account/threepid.rs +++ b/src/api/client/account/threepid.rs @@ -106,7 +106,7 @@ pub(crate) async fn add_3pid_route( let sender_user = body.sender_user(); // Require password auth to add an email - services + let _ = services .uiaa .authenticate_password(&body.auth, Some(Identity::from_user_id(sender_user))) .await?;