Initial mfa support (for internal users) #93591

Merged
Oleg-Komarov merged 46 commits from mfa into main 2024-08-29 11:44:06 +02:00
4 changed files with 18 additions and 12 deletions
Showing only changes of commit 94df1fcd80 - Show all commits

View File

@ -17,7 +17,9 @@ Disable Multi-factor Authentication
{% include "components/forms/field.html" %}
{% endwith %}
{% endwith %}
<button type="submit" class="btn-danger">Disable</button>
<a class="btn" href="{% url 'bid_main:mfa' %}">Cancel</a>
<div class="d-inline-flex mt-3">
<button type="submit" class="btn btn-danger">Disable</button>
<a class="btn btn-secondary ml-3" href="{% url 'bid_main:mfa' %}">Cancel</a>
</div>
</form>
{% endblock %}

View File

@ -25,7 +25,7 @@ Multi-factor Authentication Setup
Verification also expires after {{ agent_inactivity_days }} days of inactivity.
</p>
<div>
<a class="btn btn-danger" href="{% url 'bid_main:mfa_disable' %}">Disable</a>
<a class="btn btn-danger" href="{% url 'bid_main:mfa_disable' %}">Disable MFA</a>
</div>
{% else %}
<p>
@ -60,7 +60,7 @@ Multi-factor Authentication Setup
<div class="bid box mt-3">
<h3>Security keys (U2F, WebAuthn, FIDO2)</h3>
<p>
E.g. yubikey.
E.g. a yubikey.
</p>
<ul>
{% for d in devices_per_type.u2f %}
@ -87,12 +87,12 @@ Multi-factor Authentication Setup
{% with code_count=recovery_codes|length %}
{{ code_count }} recovery code{{ code_count|pluralize }} remaining
{% if display_recovery_codes %}
<a href="?display_recovery_codes=" class="btn">Hide</a>
<a href="?display_recovery_codes=" class="btn btn-secondary">Hide</a>
{% else %}
<a href="?display_recovery_codes=1#recovery-codes" class="btn">Display</a>
<a href="?display_recovery_codes=1#recovery-codes" class="btn btn-secondary">Display</a>
{% endif %}
<form action="{% url 'bid_main:mfa_invalidate_recovery' %}" method="post" class="d-inline-flex">{% csrf_token %}
<button class="btn-danger" type="submit">Invalidate</button>
<button class="btn btn-danger" type="submit">Invalidate</button>
</form>
{% if display_recovery_codes %}
<ul>
@ -105,7 +105,7 @@ Multi-factor Authentication Setup
</div>
{% endif %}
<form action="{% url 'bid_main:mfa_generate_recovery' %}" method="post">{% csrf_token %}
<button type="submit">{% if recovery %}Regenerate{% else %}Generate{% endif %} recovery codes</button>
<button type="submit" class="btn">{% if recovery %}Regenerate{% else %}Generate{% endif %} recovery codes</button>
</form>
{% endwith %}
</div>

View File

@ -45,8 +45,10 @@ Multi-factor Authentication Setup
{% with field=form.signature %}
{% include "components/forms/field.html" %}
{% endwith %}
<button type="submit" class="btn btn-primary">Validate</button>
<a class="btn btn-secondary" href="{% url 'bid_main:mfa' %}">Cancel</a>
<div class="d-inline-flex">
<button type="submit" class="btn btn-primary">Validate</button>
<a class="btn btn-secondary ml-3" href="{% url 'bid_main:mfa' %}">Cancel</a>
</div>
{% if form.non_field_errors %}
<div class="text-danger mt-3">
something went wrong

View File

@ -24,8 +24,10 @@ Multi-factor Authentication Setup
{% with field=form.state %}
{% include "components/forms/field.html" %}
{% endwith %}
<button type="submit" class="btn btn-primary">Add security key</button>
<a class="btn btn-secondary" href="{% url 'bid_main:mfa' %}">Cancel</a>
<div class="d-inline-flex">
<button type="submit" class="btn btn-primary">Add security key</button>
<a class="btn btn-secondary ml-3" href="{% url 'bid_main:mfa' %}">Cancel</a>
</div>
{% if form.non_field_errors %}
<div class="text-danger mt-3">
something went wrong