fix: Remove associated email on account deactivation

This commit is contained in:
Ginger
2026-03-23 09:58:03 -04:00
committed by Ellis Git
parent 20a6f0c6fb
commit 166d7d0f63
2 changed files with 10 additions and 3 deletions
+9 -2
View File
@@ -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)
+1 -1
View File
@@ -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?;