Enhance CSRF protection and user management features
- Introduce CSRF token generation and management improvements, ensuring tokens are consistently retrieved from cookies or request state. - Update user creation logic to handle validation errors more gracefully, providing user feedback for invalid input and existing email addresses. - Revise user management UI to display success and error messages, improving user experience during user creation. - Refactor admin user access checks to include additional role validation.
This commit is contained in:
@@ -13,6 +13,12 @@
|
||||
<div class="card-header">
|
||||
<h3>Neuen Benutzer anlegen</h3>
|
||||
</div>
|
||||
{% if error_message %}
|
||||
<p class="error">{{ error_message }}</p>
|
||||
{% endif %}
|
||||
{% if success_message %}
|
||||
<p class="hint" style="color:var(--tk-success);font-weight:600;">{{ success_message }}</p>
|
||||
{% endif %}
|
||||
<form method="post" action="/admin/users" class="form-grid">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
||||
<div class="form-row">
|
||||
@@ -25,7 +31,7 @@
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label>Passwort
|
||||
<input type="password" name="password" required minlength="10">
|
||||
<input type="password" name="password" required minlength="10" placeholder="Mindestens 10 Zeichen">
|
||||
</label>
|
||||
<label>Rolle
|
||||
<select name="role">
|
||||
|
||||
Reference in New Issue
Block a user