mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
fix: Remove associated email on account deactivation
This commit is contained in:
@@ -154,7 +154,7 @@ pub(crate) async fn change_password_route(
|
|||||||
.await?
|
.await?
|
||||||
} else {
|
} else {
|
||||||
// A signed-out user is trying to reset their password, prompt them for email
|
// 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
|
// have already hit `/account/password/requestToken` to send the email. We
|
||||||
// just validate it.
|
// just validate it.
|
||||||
|
|
||||||
@@ -337,7 +337,7 @@ pub(crate) async fn deactivate_route(
|
|||||||
}
|
}
|
||||||
|
|
||||||
Ok(deactivate::v3::Response {
|
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<()> {
|
) -> Result<()> {
|
||||||
services.users.deactivate_account(user_id).await.ok();
|
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
|
services
|
||||||
.users
|
.users
|
||||||
.all_profile_keys(user_id)
|
.all_profile_keys(user_id)
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ pub(crate) async fn add_3pid_route(
|
|||||||
let sender_user = body.sender_user();
|
let sender_user = body.sender_user();
|
||||||
|
|
||||||
// Require password auth to add an email
|
// Require password auth to add an email
|
||||||
services
|
let _ = services
|
||||||
.uiaa
|
.uiaa
|
||||||
.authenticate_password(&body.auth, Some(Identity::from_user_id(sender_user)))
|
.authenticate_password(&body.auth, Some(Identity::from_user_id(sender_user)))
|
||||||
.await?;
|
.await?;
|
||||||
|
|||||||
Reference in New Issue
Block a user