summaryrefslogtreecommitdiffhomepage
path: root/example/index.js
diff options
context:
space:
mode:
authorMatthew Miller <matthew@millerti.me>2020-05-22 13:40:24 -0700
committerMatthew Miller <matthew@millerti.me>2020-05-22 13:40:24 -0700
commit32091c76bb4ca45c0e4efd3df87bb5b875c05baa (patch)
tree71ace676bf59610aab85ebac6dfa91815437cfe2 /example/index.js
parent93efb3b7ddb8ce16c55fd68346016d62f45ffe8a (diff)
Add endpoint for assertion options
Diffstat (limited to 'example/index.js')
-rw-r--r--example/index.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/example/index.js b/example/index.js
index 3aa0812..5a0b8db 100644
--- a/example/index.js
+++ b/example/index.js
@@ -81,6 +81,16 @@ app.post('/verify-attestation', (req, res) => {
res.send({ verified });
});
+app.get('/generate-assertion-options', (req, res) => {
+ // You need to know the user by this point
+ const user = inMemoryUserDeviceDB[userId];
+
+ res.send(generateAssertionOptions(
+ randomChallenge,
+ user.map(data => data.base64CredentialID),
+ ));
+});
+
app.post('/verify-registration', (req, res) => {
const { body } = req;
});