fixed some bugs
This commit is contained in:
@@ -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 %}
|
||||||
|
|||||||
@@ -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):
|
||||||
|
|||||||
Reference in New Issue
Block a user