fixed some bugs

This commit is contained in:
Spitap
2022-08-20 20:17:29 +02:00
parent e06bd4d176
commit 43e33c1a12
2 changed files with 3 additions and 1 deletions

View File

@@ -103,6 +103,7 @@
{% endif %} {% endif %}
</tr> </tr>
{% endfor %} {% endfor %}
{% if "RECOVERY" not in UNALLOWED_AUTHEN_METHODS %}
<tr> <tr>
<td>RECOVERY</td> <td>RECOVERY</td>
@@ -113,6 +114,7 @@
<td>On</td> <td>On</td>
<td><a href="{% url 'manage_recovery_codes' %}"> <span class="fa fa-wrench fa-solid fa-wrench bi bi-wrench-fill"></span></a></td> <td><a href="{% url 'manage_recovery_codes' %}"> <span class="fa fa-wrench fa-solid fa-wrench bi bi-wrench-fill"></span></a></td>
</tr> </tr>
{% endif %}
{% else %} {% else %}
<tr><td colspan="7" align="center">You didn't have any keys yet.</td> </tr> <tr><td colspan="7" align="center">You didn't have any keys yet.</td> </tr>
{% endif %} {% endif %}

View File

@@ -55,7 +55,7 @@ def auth(request):
return login(request) return login(request)
elif tokenLength == 10 and "RECOVERY" not in settings.MFA_UNALLOWED_METHODS: elif tokenLength == 10 and "RECOVERY" not in settings.MFA_UNALLOWED_METHODS:
#Backup code check #Backup code check
resBackup=recovery.verify_login(request.session["base_username"], token=request.POST["otp"]) resBackup=recovery.verify_login(request, request.session["base_username"], token=request.POST["otp"])
if resBackup[0]: if resBackup[0]:
mfa = {"verified": True, "method": "RECOVERY","id":resBackup[1]} mfa = {"verified": True, "method": "RECOVERY","id":resBackup[1]}
if getattr(settings, "MFA_RECHECK", False): if getattr(settings, "MFA_RECHECK", False):