sef-global / scholarx-backend

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

Implement Google Authentication with Passport #49

Closed anjula-sack closed 7 months ago

anjula-sack commented 1 year ago

Description: As part of enhancing our application's authentication system, we need to implement Google Authentication using Passport.js and JWT (JSON Web Tokens). This will enable users to log in securely using their Google accounts and manage their sessions using JWT tokens.

Tasks:

  1. Set up Passport.js and JWT dependencies in the project to handle Google Authentication.
  2. Configure Passport.js with the Google strategy to enable authentication via Google accounts.
  3. Implement user registration endpoint to create new user accounts securely.
  4. Create a Google login endpoint that authenticates users using their Google accounts and generates JWT tokens.
  5. Implement a protected endpoint that requires a valid JWT token for access.
  6. Set up middleware to authenticate requests using Passport.js and the JWT strategy.
  7. Handle logout functionality to invalidate tokens or sessions.
  8. Implement password reset functionality for users who have forgotten their password.

Acceptance Criteria:

Additional Information:

Related Dependencies or References: