refactor/tighten-architecture #26
@@ -103,7 +103,7 @@
|
||||
{% if let Some(err) = error %}
|
||||
<p class="error">{{ err }}</p>
|
||||
{% endif %}
|
||||
<p style="font-size:.85em;opacity:.7">This user and all their data will be permanently deleted. Enter your own password to confirm.</p>
|
||||
<p style="font-size:.85em;opacity:.7">This user and all their data will be permanently deleted, fediverse servers are notified, and the username is retired for good. Enter your own password to confirm.</p>
|
||||
<form method="POST" action="/users/{{ profile_user_id }}/delete">
|
||||
<input type="hidden" name="_csrf" value="{{ ctx.csrf_token }}">
|
||||
<input type="password" name="password" placeholder="Your password" required autocomplete="current-password">
|
||||
|
||||
@@ -285,6 +285,8 @@ async fn delete_forms_render_only_where_they_apply() {
|
||||
|
||||
// A non-admin viewing someone else, and anonymous viewers, see no form.
|
||||
let bob_page = format!("/users/{}", bob.user_id);
|
||||
let (_, _, body) = send(&router, get(&bob_page, None)).await;
|
||||
assert!(!body.contains(&user_delete(&bob.user_id)), "anonymous");
|
||||
let (_, _, body) = send(&router, get(&bob_page, Some(&alice.cookie))).await;
|
||||
assert!(!body.contains(&user_delete(&bob.user_id)), "non-admin");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user