feat: classic ui account deletion
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user