Files
Escapepage/templates/tech/profile/index.html.twig
T
Frank 886208c5c0 Add profile page for changing password and email
New /profile route (nav link between Admin and Logout) with two
independent forms, both requiring the current password before
applying a change:
- Change password: standard current/new/repeat flow, same password
  strength rules as registration.
- Change email: re-checks the new address isn't already taken (avoids
  a 500 from the unique constraint), then marks the account
  unverified and re-sends the confirmation email via the existing
  EmailVerifier/verify-email flow, same as registration. The current
  session stays logged in, but the user needs to verify the new
  address before their next login (UserChecker already blocks
  unverified accounts).
2026-07-11 23:23:38 +02:00

40 lines
1.5 KiB
Twig

{% extends 'layout/site.html.twig' %}
{% block title %}Profile{% endblock %}
{% block body %}
<h1 class="mb-4">Profile</h1>
<div class="row g-4">
<div class="col-md-6">
<div class="card h-100">
<div class="card-header bg-secondary text-white">Change Email</div>
<div class="card-body">
<p class="text-muted">Current email: {{ user.email }}</p>
{{ form_start(emailForm) }}
{{ form_row(emailForm.email) }}
{{ form_row(emailForm.currentPassword) }}
<div class="d-grid mt-3">
<button type="submit" class="btn btn-primary">Update Email</button>
</div>
{{ form_end(emailForm) }}
</div>
</div>
</div>
<div class="col-md-6">
<div class="card h-100">
<div class="card-header bg-secondary text-white">Change Password</div>
<div class="card-body">
{{ form_start(passwordForm) }}
{{ form_row(passwordForm.currentPassword) }}
{{ form_row(passwordForm.plainPassword) }}
<div class="d-grid mt-3">
<button type="submit" class="btn btn-primary">Update Password</button>
</div>
{{ form_end(passwordForm) }}
</div>
</div>
</div>
</div>
{% endblock %}