Show 2FA successful login on 2FA user page

This commit is contained in:
Pierre HUBERT 2022-11-12 11:37:15 +01:00
parent 1fa36c0aff
commit 7887ccaa41

View File

@ -34,6 +34,28 @@
</tbody>
</table>
{% if !user.last_successful_2fa.is_empty() %}
<h5 style="margin-top: 50px">Successful 2FA login history</h5>
<table class="table table-hover" style="max-width: 800px;" aria-describedby="Factors list">
<thead>
<tr>
<th scope="col">IP address</th>
<th scope="col">Date</th>
<th scope="col">Bypass 2FA</th>
</tr>
</thead>
<tbody>
{% for e in user.get_formatted_2fa_successful_logins() %}
<tr>
<td>{{ e.ip }}</td>
<td>{{ e.fmt_time() }}</td>
<td>{% if e.can_bypass_2fa %}YES{% else %}NO{% endif %}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
<script>
async function delete_factor(id) {
if (!confirm("Do you really want to remove this factor?"))