summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--example/public/register/index.html16
-rw-r--r--example/public/styles.css17
2 files changed, 27 insertions, 6 deletions
diff --git a/example/public/register/index.html b/example/public/register/index.html
index 505526a..5d0362d 100644
--- a/example/public/register/index.html
+++ b/example/public/register/index.html
@@ -14,6 +14,22 @@
<span>⬅️&nbsp;<a href="/">Go Back</a></span>
</p>
<button id="btnBegin">Begin Registration</button>
+ <p id="error"></p>
</div>
+ <script>
+ const elemBegin = document.getElementById('btnBegin');
+ const elemError = document.getElementById('error');
+ const { startAttestation } = WebAuthntineBrowser;
+
+ elemBegin.addEventListener('click', (async () => {
+ console.log('getting attestation options');
+ const resp = await fetch('/generate-attestation-options');
+
+ const options = await resp.json();
+ console.log(options);
+
+ startAttestation(options);
+ }));
+ </script>
</body>
</html>
diff --git a/example/public/styles.css b/example/public/styles.css
index 9483189..bdfef52 100644
--- a/example/public/styles.css
+++ b/example/public/styles.css
@@ -13,12 +13,6 @@ body {
background: #F7F7F7;
}
-.container {
- max-width: 70rem;
- margin: auto;
- text-align: center;
-}
-
h1 {
font-size: 2.25rem;
}
@@ -36,3 +30,14 @@ button:active {
button:hover {
background: #EFEFEF;
}
+
+.container {
+ max-width: 70rem;
+ margin: auto;
+ text-align: center;
+}
+
+#error {
+ color: red;
+ font-weight: bold;
+}