Can clear 2FA login history from edit_user page

This commit is contained in:
2022-11-12 11:16:55 +01:00
parent 7a3eaa944e
commit 7e1cbb184d
6 changed files with 226 additions and 10 deletions

View File

@ -98,6 +98,28 @@
</fieldset>
{% endif %}
<!-- Two factor authentication history -->
{% if !u.last_successful_2fa.is_empty() %}
<fieldset class="form-group">
<legend class="mt-4">Last successful 2FA authentications</legend>
<!-- Clear 2FA history -->
<div class="form-check">
<input class="form-check-input" type="checkbox" name="clear_2fa_history" id="clear_2fa_history">
<label class="form-check-label" for="clear_2fa_history">
Clear 2FA authentication history
</label>
</div>
<ul>
{% for e in u.get_formatted_2fa_successful_logins() %}
{% if e.can_bypass_2fa %}<li style="font-weight: bold;">{{ e.ip }} - {{ e.fmt_time() }} - BYPASS 2FA</li>
{% else %}<li>{{ e.ip }} - {{ e.fmt_time() }}</li>{% endif %}
{% endfor %}
</ul>
</fieldset>
{% endif %}
<!-- Granted clients -->
<fieldset class="form-group">
<legend class="mt-4">Granted clients</legend>