~tsileo/blobstash-app-webauthn-demo

ref: 6f50bda1356df4101a6dc2efbb7f66c5fcb28200 blobstash-app-webauthn-demo/templates/register.html -rw-r--r-- 564 bytes
6f50bda1Thomas Sileo Initial commit 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{{ define "body" }}
<p><a href="#" id="register_link">begin register</a></p>
<form action="" method="POST">
    <input type="text" id="rpayload" value="" name="data">
    <input type="submit" value="finish register">
</form>
<script src="{{ url_for_js "/webauthn.js" }}"></script>
<script>
var credentialCreationOptions = JSON.parse({{.js}});
document.getElementById("register_link").onclick = function() {
  Webauthn.register(credentialCreationOptions, payload =>
    document.getElementById("rpayload").value = JSON.stringify(payload)
  );
}
</script>
{{ end }}