Skip to content

Commit

Permalink
bug fix with multiple posts of same session id
Browse files Browse the repository at this point in the history
  • Loading branch information
endimion committed Apr 25, 2024
1 parent d973e9d commit da45c3a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion routes/codeFlowJwtRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" });
}
Expand Down
2 changes: 1 addition & 1 deletion routes/codeFlowSdJwtRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" });
}
Expand Down
2 changes: 1 addition & 1 deletion routes/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" });
}
Expand Down

0 comments on commit da45c3a

Please sign in to comment.