diff options
author | Matthew Miller <matthew@millerti.me> | 2023-09-04 08:14:31 -0700 |
---|---|---|
committer | Matthew Miller <matthew@millerti.me> | 2023-09-04 08:14:42 -0700 |
commit | 7c7b9cb681e68ede46c19f95a063da3420a53aa2 (patch) | |
tree | 5b7791db4ded6857b615a56b8b0f0eaba2f6e80d /example/index.ts | |
parent | c0dc569fc884541cb1864206240979790467987f (diff) |
Update example to server v8.1.0
Diffstat (limited to 'example/index.ts')
-rw-r--r-- | example/index.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/example/index.ts b/example/index.ts index 9f4204d..4b4179a 100644 --- a/example/index.ts +++ b/example/index.ts @@ -112,7 +112,7 @@ const inMemoryUserDeviceDB: { [loggedInUserId: string]: LoggedInUser } = { /** * Registration (a.k.a. "Registration") */ -app.get('/generate-registration-options', (req, res) => { +app.get('/generate-registration-options', async (req, res) => { const user = inMemoryUserDeviceDB[loggedInUserId]; const { @@ -150,7 +150,7 @@ app.get('/generate-registration-options', (req, res) => { supportedAlgorithmIDs: [-7, -257], }; - const options = generateRegistrationOptions(opts); + const options = await generateRegistrationOptions(opts); /** * The server needs to temporarily remember this value for verification, so don't lose it until @@ -215,7 +215,7 @@ app.post('/verify-registration', async (req, res) => { /** * Login (a.k.a. "Authentication") */ -app.get('/generate-authentication-options', (req, res) => { +app.get('/generate-authentication-options', async (req, res) => { // You need to know the user by this point const user = inMemoryUserDeviceDB[loggedInUserId]; @@ -230,7 +230,7 @@ app.get('/generate-authentication-options', (req, res) => { rpID, }; - const options = generateAuthenticationOptions(opts); + const options = await generateAuthenticationOptions(opts); /** * The server needs to temporarily remember this value for verification, so don't lose it until |