jinx-vi-0 / BlogLog

BlogLog - Your personalized blogging companion
18 stars 34 forks source link

Duplicate Session Middleware in app.js causing Potential Conflicts #72

Open chikatlarakesh opened 3 hours ago

chikatlarakesh commented 3 hours ago

GSSoC 2024 extended and hacktoberfest contributor

Describe the bug

There are two instances of the session() middleware in app.js, which could potentially cause conflicts in session management. The first instance is redundant as the second instance already handles session storage with MongoDB integration.

To Reproduce

Steps to reproduce the behavior:

  1. Open the app.js file.
  2. Review the two instances of session() middleware.
  3. Observe that both are performing session handling, leading to a potential conflict.
  4. See that the application may face issues in properly storing sessions.

Expected behavior

Only one instance of the session() middleware should be used. The second instance, which integrates MongoDB session storage, should be sufficient for proper session handling.

Screenshots

(Not applicable, as this is a code-related issue.)

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context

The issue arises because the first session middleware is unnecessary and could interfere with MongoDB session handling, especially in a production environment where proper session management is critical.

github-actions[bot] commented 3 hours ago

👋 Hey there, rockstar! Thanks for dropping an issue! The BlogLog team is on it like pineapple on pizza (love it or hate it). Stick around, magic's about to happen!