forked from GithubBackups/healthchecks
Add notes about adding a second key, and removing the last key
This commit is contained in:
parent
568a287850
commit
8448f882cf
@ -223,7 +223,7 @@ def profile(request):
|
|||||||
"2fa_status": "default",
|
"2fa_status": "default",
|
||||||
"added_credential_name": request.session.pop("added_credential_name", ""),
|
"added_credential_name": request.session.pop("added_credential_name", ""),
|
||||||
"removed_credential_name": request.session.pop("removed_credential_name", ""),
|
"removed_credential_name": request.session.pop("removed_credential_name", ""),
|
||||||
"credentials": request.user.credentials.order_by("id"),
|
"credentials": list(request.user.credentials.order_by("id")),
|
||||||
"use_2fa": settings.RP_ID,
|
"use_2fa": settings.RP_ID,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -658,7 +658,7 @@ def remove_credential(request, code):
|
|||||||
credential.delete()
|
credential.delete()
|
||||||
return redirect("hc-profile")
|
return redirect("hc-profile")
|
||||||
|
|
||||||
ctx = {"credential": credential}
|
ctx = {"credential": credential, "is_last": request.user.credentials.count() == 1}
|
||||||
return render(request, "accounts/remove_credential.html", ctx)
|
return render(request, "accounts/remove_credential.html", ctx)
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
{{ registration_dict|json_script:"registration" }}
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<form
|
<form
|
||||||
id="add-credential-form"
|
id="add-credential-form"
|
||||||
|
@ -68,7 +68,7 @@
|
|||||||
<form method="post">
|
<form method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<h2>Two-factor Authentication</h2>
|
<h2>Two-factor Authentication</h2>
|
||||||
{% if credentials.exists %}
|
{% if credentials %}
|
||||||
|
|
||||||
<table id="my-keys" class="table">
|
<table id="my-keys" class="table">
|
||||||
<tr>
|
<tr>
|
||||||
@ -87,10 +87,18 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
{% if credentials|length == 1 %}
|
||||||
|
<p class="alert alert-info">
|
||||||
|
<strong>Tip: add a second key!</strong>
|
||||||
|
It is a good practice to register at least two security keys
|
||||||
|
and store them separately.
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
<p>
|
<p>
|
||||||
Your account has no registered security keys.<br />
|
Your account has no registered security keys.<br />
|
||||||
Two-factor authentication is disabled.
|
Two-factor authentication is not active.
|
||||||
</p>
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<a
|
<a
|
||||||
|
@ -12,8 +12,17 @@
|
|||||||
<p></p>
|
<p></p>
|
||||||
<p>You are about to remove
|
<p>You are about to remove
|
||||||
the security key <strong>{{ credential.name|default:'unnamed' }}</strong>
|
the security key <strong>{{ credential.name|default:'unnamed' }}</strong>
|
||||||
from your two-factor authentication methods. Are you sure?
|
from your two-factor authentication methods.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
{% if is_last %}
|
||||||
|
<p>
|
||||||
|
After removing this key,
|
||||||
|
<strong>two-factor authentication will no longer be active</strong>
|
||||||
|
for your {% site_name%} account.
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<div class="text-right">
|
<div class="text-right">
|
||||||
<a
|
<a
|
||||||
href="{% url 'hc-profile' %}"
|
href="{% url 'hc-profile' %}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user