use auth screen to make more clear this is about security

This commit is contained in:
Matthias 2021-10-31 23:07:25 +01:00
parent 7719a07f19
commit 85da98a004
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076
4 changed files with 101 additions and 0 deletions

View File

@ -0,0 +1,15 @@
{% extends "account/base.html" %}
{% load i18n crispy_forms_tags %}
{% block content %}
<h1>{% trans "Two-Factor Authentication" %}</h1>
<form method="post" class="login">
{% csrf_token %}
{{ form|crispy }}
<button type="submit" class="btn btn-primary">
{% trans 'Authenticate' %}
</button>
</form>
{% endblock %}

View File

@ -0,0 +1,32 @@
{% extends "account/base.html" %}
{% load i18n %}
{% block content %}
<h1>
{% trans "Two-Factor Authentication Backup Tokens" %}
</h1>
{% if backup_tokens %}
{% if reveal_tokens %}
<ul>
{% for token in backup_tokens %}
<li>{{ token.token }}</li>
{% endfor %}
</ul>
{% else %}
{% trans 'Backup tokens have been generated, but are not revealed here for security reasons. Press the button below to generate new ones.' %}
{% endif %}
{% else %}
{% trans 'No tokens. Press the button below to generate some.' %}
{% endif %}
<form method="post">
{% csrf_token %}
<button type="submit">
{% trans 'Generate backup tokens' %}
</button>
</form>
<a href="{% url 'two-factor-remove' %}">Disable Two Factor</a>
{% endblock %}

View File

@ -0,0 +1,18 @@
{% extends "account/base.html" %}
{% load i18n %}
{% block content %}
<h1>
{% trans "Disable Two-Factor Authentication" %}
</h1>
<p>{% trans "Are you sure?" %}</p>
<form method="post">
{% csrf_token %}
<button type="submit">
{% trans 'Disable Two-Factor' %}
</button>
</form>
{% endblock %}

View File

@ -0,0 +1,36 @@
{% extends "account/base.html" %}
{% load i18n %}
{% block content %}
<h1>
{% trans "Setup Two-Factor Authentication" %}
</h1>
<h4>
{% trans 'Step 1' %}:
</h4>
<p>
{% trans 'Scan the QR code below with a token generator of your choice (for instance Google Authenticator).' %}
</p>
<img src="{{ qr_code_url }}" />
<h4>
{% trans 'Step 2' %}:
</h4>
<p>
{% trans 'Input a token generated by the app:' %}
</p>
<form method="post">
{% csrf_token %}
{{ form.non_field_errors }}
{{ form.token.label }}: {{ form.token }}
<button type="submit">
{% trans 'Verify' %}
</button>
</form>
{% endblock %}