feat: classic ui account deletion

This commit is contained in:
2026-10-26 02:51:52 +01:00
parent 0beedfbf0a
commit 6aebad1f0f
4 changed files with 98 additions and 8 deletions

View File

@@ -236,6 +236,9 @@ pub async fn post_delete_user(
// An admin removing their own account ends their own session too.
Ok(()) if own => super::auth::get_logout(State(state)).await.into_response(),
Ok(()) => axum::response::Redirect::to("/users").into_response(),
// Same as other forbidden classic actions: a plain 403, not a redirect
// to a page that would not show the error.
Err(e @ DomainError::Forbidden(_)) => crate::errors::domain_error_response(e),
Err(e) => axum::response::Redirect::to(&format!(
"/users/{target}?error={}",
crate::html::helpers::encode_domain_error(&e)