Implement support for password change and logout

Note the hack.
This commit is contained in:
Jonas Schäfer
2020-02-29 13:41:08 +01:00
parent 90273960d3
commit 9318b0d152
7 changed files with 198 additions and 32 deletions

View File

@@ -6,5 +6,9 @@
<body>
<h1>Welcome!</h1>
<p>Welcome home, {{ user_info.username }}.</p>
<ul>
<li><a href="{{ url_for('user.change_pw') }}">Change password</a></li>
<li><a href="{{ url_for('user.logout') }}">Log out</a></li>
</ul>
</body>
</html>

View File

@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<body>
<form method="POST">
{{ form.csrf_token }}
<input type="submit" value="Logout">
</form>
</body>
</html>

View File

@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<body>
<form method="POST">
{{ form.csrf_token }}
{{ form.current_password }}
{{ form.new_password }}
{{ form.new_password_confirm }}
<ul>
{% for field, errors in form.errors.items() %}
{% for error in errors %}
<li>{{ field }}: {{ error }}</li>
{% endfor %}
{% endfor %}
</ul>
<input type="submit" value="Change password">
</form>
</body>
</html>