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