Add webauthn #8
@ -15,7 +15,7 @@
|
||||
</div>
|
||||
|
||||
<input type="button" class="btn btn-primary" value="Start enrollment" onclick="startEnrollment()"
|
||||
style="margin-top: 20px;"/>
|
||||
style="margin-top: 20px;" id="submitButton" />
|
||||
|
||||
<script src="/assets/js/base64_lib.js"></script>
|
||||
<script>
|
||||
@ -30,8 +30,10 @@
|
||||
REGISTRATION_CHALLENGE.publicKey.user.id
|
||||
);
|
||||
|
||||
const submitButton = document.getElementById("submitButton");
|
||||
|
||||
async function startEnrollment() {
|
||||
submitButton.disabled = true;
|
||||
try {
|
||||
const factorNameInput = document.getElementById("inputKeyName");
|
||||
factorNameInput.classList.remove("is-invalid");
|
||||
@ -77,6 +79,8 @@
|
||||
} catch(e) {
|
||||
console.error(e);
|
||||
alert("Failed enrollment, please try again!");
|
||||
} finally {
|
||||
submitButton.disabled = false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user