Add webauthn #8

Merged
pierre merged 10 commits from webauthn into master 2022-04-23 18:25:16 +00:00
Showing only changes of commit f09a62f8df - Show all commits

View File

@ -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>