mirror of
https://github.com/StefBuwalda/cal_counter.git
synced 2025-10-30 03:10:00 +00:00
Introduces a change password route, form, and template, allowing authenticated users to update their password. Updates the User model with a method to set the must_change_password flag. Adjusts login and navigation logic to support the new flow and ensures users are redirected to change their password if required.
46 lines
1.7 KiB
HTML
46 lines
1.7 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block content %}
|
|
<div class="container d-flex justify-content-center align-items-center">
|
|
<div class="card shadow-sm p-4" style="width: 100%; max-width: 400px;">
|
|
<h3 class="mb-4 text-center">Login</h3>
|
|
<form method="post">
|
|
{{ form.hidden_tag() }}
|
|
|
|
<div class="mb-3">
|
|
{{ form.current_password.label(class="form-label") }}
|
|
{{ form.current_password(class="form-control", placeholder="") }}
|
|
{% if form.current_password.errors %}
|
|
<div class="text-danger small">
|
|
{{ form.current_password.errors[0] }}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
{{ form.new_password.label(class="form-label") }}
|
|
{{ form.new_password(class="form-control", placeholder="Enter password") }}
|
|
{% if form.new_password.errors %}
|
|
<div class="text-danger small">
|
|
{{ form.new_password.errors[0] }}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
{{ form.confirm_password.label(class="form-label") }}
|
|
{{ form.confirm_password(class="form-control", placeholder="Enter password") }}
|
|
{% if form.confirm_password.errors %}
|
|
<div class="text-danger small">
|
|
{{ form.confirm_password.errors[0] }}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="d-grid">
|
|
{{ form.submit(class="btn btn-primary btn-lg") }}
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
{% endblock%} |