Add a way to reset password

This commit is contained in:
Greg Burri 2024-11-09 11:22:53 +01:00
parent 5d343c273f
commit ed979719b5
12 changed files with 352 additions and 57 deletions

View file

@ -2,7 +2,7 @@
{% block main_container %}
<div class="content">
<form action="/signup" method="post">
<form action="/ask_reset_password" method="post">
<label for="email_field">Your email address</label>
<input id="email_field" type="text" name="email" value="{{ email }}" autocapitalize="none" autocomplete="email" autofocus="autofocus" />
{{ message_email }}

View file

@ -10,9 +10,7 @@
<span><a href="/edit_profile">{{ user.email }}</a> / <a href="/signout" />Sign out</a></span>
{% when None %}
<span>
<a href="/signin" >Sign in</a>/
<a href="/signup">Sign up</a>/
<a href="/lost_password">Lost password</a>
<a href="/signin" >Sign in</a>/<a href="/signup">Sign up</a>/<a href="/ask_reset_password">Lost password</a>
</span>
{% endmatch %}

View file

@ -0,0 +1,23 @@
{% extends "base_with_list.html" %}
{% block content %}
<label for="title_field">Title</label>
<input
id="title_field"
type="text"
name="title"
value="{{ current_recipe.title }}"
autocapitalize="none"
autocomplete="title"
autofocus="autofocus" />
<label for="description_field">Description</label>
<input
id="title_field"
type="text"
name="title"
value="{{ current_recipe.description }}"
autocapitalize="none"
autocomplete="title"
autofocus="autofocus" />
{% endblock %}

View file

@ -0,0 +1,20 @@
{% extends "base_with_header.html" %}
{% block main_container %}
<div class="content">
<form action="/reset_password" method="post">
<label for="password_field_1">Choose a new password (minimum 8 characters)</label>
<input id="password_field_1" type="password" name="password_1" />
<label for="password_field_1">Re-enter password</label>
<input id="password_field_2" type="password" name="password_2" />
{{ message_password }}
<input type="hidden" name="reset_token" value="{{ reset_token }}" />
<input type="submit" name="commit" value="Reset password" />
</form>
{{ message }}
</div>
{% endblock %}