Put button inside the form
This commit is contained in:
parent
e892535287
commit
c0a751ff13
|
@ -22,10 +22,12 @@
|
||||||
<form id="formRegisterKey" method="post">
|
<form id="formRegisterKey" method="post">
|
||||||
{{ fido_token_form.csrf_token }}
|
{{ fido_token_form.csrf_token }}
|
||||||
{{ fido_token_form.sk_assertion(class="form-control", placeholder="") }}
|
{{ fido_token_form.sk_assertion(class="form-control", placeholder="") }}
|
||||||
|
|
||||||
|
<div class="text-center">
|
||||||
|
<button id="btnVerifyKey" class="btn btn-success mt-2" onclick="verifyKey();">Use your security key</button>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<div class="text-center">
|
|
||||||
<button id="btnVerifyKey" class="btn btn-success mt-2">Use your security key</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% if enable_otp %}
|
{% if enable_otp %}
|
||||||
<hr>
|
<hr>
|
||||||
|
@ -68,7 +70,6 @@
|
||||||
$('#formRegisterKey').submit();
|
$('#formRegisterKey').submit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#btnVerifyKey").click(verifyKey);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{% if auto_activate %}
|
{% if auto_activate %}
|
||||||
|
|
|
@ -22,10 +22,11 @@
|
||||||
|
|
||||||
{{ fido_token_form.key_name(class="form-control", placeholder="Name of your key (Required)") }}
|
{{ fido_token_form.key_name(class="form-control", placeholder="Name of your key (Required)") }}
|
||||||
{{ render_field_errors(fido_token_form.key_name) }}
|
{{ render_field_errors(fido_token_form.key_name) }}
|
||||||
|
|
||||||
|
<div class="text-center">
|
||||||
|
<button id="btnRegisterKey" class="btn btn-lg btn-primary mt-2" onclick="registerKey();">Register Key</button>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<div class="text-center">
|
|
||||||
<button id="btnRegisterKey" class="btn btn-lg btn-primary mt-2">Register Key</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
async function registerKey() {
|
async function registerKey() {
|
||||||
|
@ -55,14 +56,6 @@
|
||||||
$('#formRegisterKey').submit();
|
$('#formRegisterKey').submit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#btnRegisterKey").click(registerKey);
|
|
||||||
|
|
||||||
document.getElementById("key_name").addEventListener("keydown", event => {
|
|
||||||
if (event.keyCode === 13) {
|
|
||||||
event.preventDefault();
|
|
||||||
document.getElementById("btnRegisterKey").click();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue