diff options
author | Matthew Miller <matthew@millerti.me> | 2020-10-07 21:39:01 -0700 |
---|---|---|
committer | Matthew Miller <matthew@millerti.me> | 2020-10-07 21:39:01 -0700 |
commit | 8e57b87b70a367a530f6ccece32b072fc0765b25 (patch) | |
tree | 5277a1dd54d389b3cdfc2a38b274bc183db6ec9d /example/index.js | |
parent | c82266544479e91af6f6ca5dd03a20a76fbb6184 (diff) |
Upgrade example to v0.10.0
Diffstat (limited to 'example/index.js')
-rw-r--r-- | example/index.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/example/index.js b/example/index.js index 6a80e72..00e60e5 100644 --- a/example/index.js +++ b/example/index.js @@ -123,14 +123,18 @@ app.get('/generate-attestation-options', (req, res) => { userID: loggedInUserId, userName: username, timeout: 60000, - attestationType: 'direct', + attestationType: 'indirect', /** * Passing in a user's list of already-registered authenticator IDs here prevents users from * registering the same device multiple times. The authenticator will simply throw an error in * the browser if it's asked to perform an attestation when one of these ID's already resides * on it. */ - excludedCredentialIDs: devices.map(dev => dev.credentialID), + excludeCredentials: devices.map(dev => ({ + id: dev.credentialID, + type: 'public-key', + transports: ['usb', 'ble', 'nfc', 'internal'], + })), /** * The optional authenticatorSelection property allows for specifying more constraints around * the types of authenticators that users to can use for attestation @@ -201,7 +205,11 @@ app.get('/generate-assertion-options', (req, res) => { const options = generateAssertionOptions({ timeout: 60000, - allowedCredentialIDs: user.devices.map(data => data.credentialID), + allowCredentials: user.devices.map(dev => ({ + id: dev.credentialID, + type: 'public-key', + transports: ['usb', 'ble', 'nfc', 'internal'], + })), /** * This optional value controls whether or not the authenticator needs be able to uniquely * identify the user interacting with it (via built-in PIN pad, fingerprint scanner, etc...) |