sef-global / scholarx-backend

This is the backend of the ScholarX
MIT License
10 stars 37 forks source link

Implement the logout endpoint #61

Closed anjula-sack closed 1 year ago

anjula-sack commented 1 year ago

Description: Continuing our commitment to fortify the security and user interaction within our authentication system, we are introducing a new API endpoint: /api/auth/logout. This endpoint will facilitate the secure logout of users, ensuring that their session-related data is effectively invalidated and cleared from the HttpOnly cookies. This feature will be integrated within our existing Passport.js and JWT (JSON Web Tokens) framework, delivering a seamless and secure logout experience.

Tasks:

  1. Incorporate the required dependencies for Passport.js and JWT within the project.
  2. Configure Passport.js to effectively manage user sessions and authentication.
  3. Develop a user registration endpoint, maintaining stringent security measures for new account creation.
  4. Create a login endpoint, enabling users to access their accounts securely and initiating the use of HttpOnly cookies.
  5. Implement a protected endpoint, ensuring exclusive access to users with valid session cookies.
  6. Set up middleware to authenticate incoming requests using Passport.js and validate session cookies.
  7. Establish a streamlined session logout feature through the /api/auth/logout endpoint, effectively invalidating session cookies.
  8. Thoroughly document the newly added /api/auth/logout endpoint, detailing input parameters and response formats.

Acceptance Criteria:

Additional Information:

Related Dependencies or References: