summaryrefslogtreecommitdiffhomepage
path: root/example
diff options
context:
space:
mode:
authorMatthew Miller <matthew@millerti.me>2023-04-16 18:14:27 -0700
committerMatthew Miller <matthew@millerti.me>2023-04-16 18:14:27 -0700
commit8fe2ccad869b6cb2efee864ad8a8c6fc83d6a060 (patch)
tree0fae24a2a7a918c310699f621b0ce653a7d8146c /example
parent5fbb82376d4cece37b6f9feb73549de66bcef4b4 (diff)
Use request session for currentChallege
Diffstat (limited to 'example')
-rw-r--r--example/fido-conformance.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/example/fido-conformance.ts b/example/fido-conformance.ts
index 3ef6dbf..180804d 100644
--- a/example/fido-conformance.ts
+++ b/example/fido-conformance.ts
@@ -140,7 +140,7 @@ fidoConformanceRouter.post('/attestation/options', (req, res) => {
supportedAlgorithmIDs,
});
- user.currentChallenge = opts.challenge;
+ req.session.currentChallenge = opts.challenge;
return res.send({
...opts,
@@ -157,7 +157,7 @@ fidoConformanceRouter.post('/attestation/result', async (req, res) => {
const user = inMemoryUserDeviceDB[`${loggedInUsername}`];
- const expectedChallenge = user.currentChallenge;
+ const expectedChallenge = req.session.currentChallenge;
let verification;
try {
@@ -222,7 +222,7 @@ fidoConformanceRouter.post('/assertion/options', (req, res) => {
})),
});
- user.currentChallenge = opts.challenge;
+ req.session.currentChallenge = opts.challenge;
user.currentAuthenticationUserVerification = userVerification;
return res.send({
@@ -239,7 +239,7 @@ fidoConformanceRouter.post('/assertion/result', async (req, res) => {
const user = inMemoryUserDeviceDB[`${loggedInUsername}`];
// Pull up values specified when generation authentication options
- const expectedChallenge = user.currentChallenge;
+ const expectedChallenge = req.session.currentChallenge;
const userVerification = user.currentAuthenticationUserVerification;
if (!id) {