From b9c6883d9dd31800ccc9a293f69316f5731f5595 Mon Sep 17 00:00:00 2001 From: Arnaud Dagnelies Date: Thu, 8 Aug 2024 08:55:08 +0200 Subject: [PATCH] fixed demos with new challenge function --- docs/demos/js/basic.js | 6 +++--- docs/demos/js/conditional-ui.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/demos/js/basic.js b/docs/demos/js/basic.js index 6a3ac60..458b082 100644 --- a/docs/demos/js/basic.js +++ b/docs/demos/js/basic.js @@ -1,4 +1,4 @@ -import { client, parsers } from './webauthn.min.js' +import { client, parsers, server } from './webauthn.min.js' Vue.prototype.$buefy.config.setOptions({ defaultProgrammaticPromise : true @@ -27,7 +27,7 @@ const app = new Vue({ try { // 1. Get a challenge from the server - const challenge = window.crypto.randomUUID(); // faking it here of course + const challenge = server.randomChallenge(); // should be remotely fetched of course // 2. Invoking WebAuthn in the browser const registration = await client.register({ @@ -66,7 +66,7 @@ const app = new Vue({ try { // 1. Get a challenge from the server - const challenge = window.crypto.randomUUID(); // faking it here of course + const challenge = server.randomChallenge(); // should be remotely fetched of course // 2. Invoking WebAuthn in the browser const authentication = await client.authenticate({ diff --git a/docs/demos/js/conditional-ui.js b/docs/demos/js/conditional-ui.js index 73a77c7..3bd6fb4 100644 --- a/docs/demos/js/conditional-ui.js +++ b/docs/demos/js/conditional-ui.js @@ -1,4 +1,4 @@ -import { client, parsers } from './webauthn.min.js' +import { client, parsers, server } from './webauthn.min.js' Vue.prototype.$buefy.config.setOptions({ defaultProgrammaticPromise : true @@ -29,7 +29,7 @@ const app = new Vue({ try { // 1. Get a challenge from the server - const challenge = window.crypto.randomUUID(); // faking it here of course + const challenge = server.randomChallenge(); // should be remotely fetched of course // 2. Invoking WebAuthn in the browser const registration = await client.register({ @@ -72,7 +72,7 @@ const app = new Vue({ try { // 1. Get a challenge from the server - const challenge = window.crypto.randomUUID(); // faking it here of course + const challenge = server.randomChallenge(); // should be remotely fetched of course // 2. Invoking WebAuthn in the browser const authentication = await client.authenticate({