diff --git a/routes/codeFlowJwtRoutes.js b/routes/codeFlowJwtRoutes.js index 8a4f2e8..e1e91c2 100644 --- a/routes/codeFlowJwtRoutes.js +++ b/routes/codeFlowJwtRoutes.js @@ -20,7 +20,7 @@ codeFlowRouter.get(["/offer-code"], async (req, res) => { const uuid = req.query.sessionId ? req.query.sessionId : uuidv4(); const codeSessions = getAuthCodeSessions(); - if (codeSessions.indexOf(uuid) < 0) { + if (codeSessions.sessions.indexOf(uuid) < 0) { codeSessions.sessions.push(uuid); codeSessions.results.push({ sessionId: uuid, status: "pending" }); } diff --git a/routes/codeFlowSdJwtRoutes.js b/routes/codeFlowSdJwtRoutes.js index c562c9d..c3bfa6f 100644 --- a/routes/codeFlowSdJwtRoutes.js +++ b/routes/codeFlowSdJwtRoutes.js @@ -17,7 +17,7 @@ const serverURL = process.env.SERVER_URL || "http://localhost:3000"; codeFlowRouterSDJWT.get(["/offer-code-sd-jwt"], async (req, res) => { const uuid = req.query.sessionId ? req.query.sessionId : uuidv4(); const codeSessions = getAuthCodeSessions(); - if (codeSessions.indexOf(uuid) < 0) { + if (codeSessions.sessions.indexOf(uuid) < 0) { codeSessions.sessions.push(uuid); codeSessions.results.push({ sessionId: uuid, status: "pending" }); } diff --git a/routes/routes.js b/routes/routes.js index acfd57b..2517591 100644 --- a/routes/routes.js +++ b/routes/routes.js @@ -43,7 +43,7 @@ console.log(privateKey); router.get(["/offer"], async (req, res) => { const uuid = req.query.sessionId ? req.query.sessionId : uuidv4(); const preSessions = getPreCodeSessions(); - if (preSessions.indexOf(uuid) < 0) { + if (preSessions.sessions.indexOf(uuid) < 0) { preSessions.sessions.push(uuid); preSessions.results.push({ sessionId: uuid, status: "pending" }); }