add working signup + login

This commit is contained in:
sam 2023-09-04 03:33:13 +02:00
parent bc85b7c340
commit d8cb8c8fa8
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
27 changed files with 600 additions and 39 deletions

View file

@ -1,19 +1,33 @@
{% extends 'base.tpl' %}
{% block title %}
Log in
Log in • {{ config.Name }}
{% endblock %}
{% block content %}
<div class="auth">
<form method="post">
<p>
<label for="username">Username</label>
<input type="text" name="username" />
</p>
<p>
<label for="username">Password</label>
<input type="password" name="password" />
</p>
<input type="submit" value="Log in" />
</form>
{% if flash_message %}
<p>{{ flash_message }}</p>
{% endif %}
{% if not totp %}
<form method="post">
<p>
<label for="username">Username</label>
<input type="text" name="username" />
</p>
<p>
<label for="username">Password</label>
<input type="password" name="password" />
</p>
<input type="submit" value="Log in" />
</form>
{% else %}
<form method="post">
<p>
<label for="totp_code">Two-factor authentication code</label>
<input type="text" name="totp_code" />
</p>
<input type="text" name="totp_ticket" value="{{ totp_ticket }}" disabled />
<input type="submit" value="Log in" />
</form>
{% endif %}
</div>
{% endblock %}

View file

@ -0,0 +1,30 @@
{% extends 'base.tpl' %}
{% block title %}
Sign up &bull; {{ config.Name }}
{% endblock %}
{% block content %}
<div class="auth">
{% if flash_message %}
<p>{{ flash_message }}</p>
{% endif %}
<form method="post">
<p>
<label for="username">Username</label>
<input type="text" name="username" />
</p>
<p>
<label for="username">Email</label>
<input type="email" name="email" />
</p>
<p>
<label for="username">Password</label>
<input type="password" name="password" />
</p>
<p>
<label for="username">Repeat password</label>
<input type="password" name="repeat_password" />
</p>
<input type="submit" value="Sign up" />
</form>
</div>
{% endblock %}