feat(reset_password): add invitation and reset password activation basic flow

This commit is contained in:
Matthieu Bessat 2024-12-02 18:39:00 +01:00
parent b956bdbf05
commit 8d20cab18f
14 changed files with 328 additions and 20 deletions

View file

@ -0,0 +1,11 @@
{% extends "layouts/base.html" %}
{% block body %}
<h1>Internal server error</h1>
{% if error %}
<div class="alert alert-danger">
We are sorry. We've rencountered an unrecoverable error.
</div>
{% endif %}
{% endblock %}

View file

@ -0,0 +1,54 @@
{% extends "layouts/base.html" %}
{% block body %}
{% if reason == "Invitation" %}
<h1>Invitation</h1>
{% endif %}
{% if reason == "LostPassword" %}
<h1>Reset your password</h1>
{% endif %}
<!-- Reset password form -->
{% if error %}
<div class="alert alert-danger">
Error: {{ error }}
</div>
{% endif %}
{% if info %}
<div class="alert alert-info">
Info: {{ info }}
</div>
{% endif %}
{% if reason == "Invitation" %}
<p>
Pour activer votre compte, veuillez définir votre mot de passe.
</p>
{% endif %}
{% if reason == "LostPassword" %}
<p>
Votre mot de passe est perdu, veuillez définir un nouveau mot de passe.
</p>
{% endif %}
<form id="reset-password-form" method="post" action="/reset-password">
<div class="mb-3">
<label for="password" class="form-label">New password</label>
<input
id="password" name="password" type="password"
required
class="form-control"
/>
</div>
<div class="mb-3">
<label for="password" class="form-label">New password confirmation</label>
<input
id="password_confirmation" name="password_confirmation" type="password"
required
class="form-control"
/>
</div>
<input
id="token" name="token" type="hidden"
value="{{ token }}"
/>
<button type="submit" class="btn btn-primary">Change password</button>
</form>
{% endblock %}