Initial Import
This commit is contained in:
36
mfa/templates/mfa_check.html
Normal file
36
mfa/templates/mfa_check.html
Normal file
@@ -0,0 +1,36 @@
|
||||
<script type="application/javascript">
|
||||
mfa_success_function=null;
|
||||
mfa_failed_function=null;
|
||||
function is_mfa() {
|
||||
{% if request.session.mfa.verified %}
|
||||
return true;
|
||||
{% else %}
|
||||
return false;
|
||||
{% endif %}
|
||||
}
|
||||
function recheck_mfa(success_func,fail_func,must_mfa) {
|
||||
if (!must_mfa) success_func()
|
||||
window.mfa_success_function=success_func;
|
||||
window.mfa_failed_function=fail_func;
|
||||
$.ajax({
|
||||
"url":"{% url 'mfa_recheck' %}",
|
||||
success:function (data) {
|
||||
if (data.hasOwnProperty("res")) {
|
||||
if (data["res"])
|
||||
success_func();
|
||||
else fail_func();
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#modal-title").html("Recheck Indentity")
|
||||
$("#modal-body").html(data["html"])
|
||||
$("#popUpModal").modal()
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
{% include "modal.html" %}
|
||||
Reference in New Issue
Block a user