Skip to content

Conversation

@CodingPhionix
Copy link

@CodingPhionix CodingPhionix commented Feb 22, 2024

Fix-issue: #2 , #1 , #5, #7

Issue #1 :

I implemented a login route using Node.js and Express. The solution involved the following steps:

  1. Validation: I validated the request body to ensure it contained the required fields, namely email and password.

  2. Authentication: I authenticated the user by checking if the provided email and password matched the credentials stored in the system.

  3. JWT Token Generation: Upon successful authentication, I generated a JSON Web Token (JWT) containing the user's information and signed it with a secret key.

  4. Response: Finally, I returned the JWT token along with a success message indicating that the user logged in successfully.

This approach ensures secure authentication and enables users to access protected routes using the issued JWT token.

Next I did was Issue #2 :

  1. Added user signup route (POST http://localhost:3000/auth/signup) handling.
  2. Hashed user password using bcryptjs for security.
  3. Saved user details to the database upon successful signup.
  4. Returned a success message and user details upon successful signup.
  5. This enhancement ensures a secure and seamless signup experience for new users.

Issue #5 :

  • Added a controller to fetch all books from the database.
  • Used the Book model to retrieve book data from the database.
  • Returned the fetched books in the response along with a success message.

Issue #7 :

  • Added a controller to handle book deletion by ID.
  • Utilized the Book model to find and remove the book from the database.
  • Returned a success message upon successful deletion of the book.

fix: issue OpenSourceSprint#5
- Added a controller to fetch all books from the database.
- Used the Book model to retrieve book data from the database.
- Returned the fetched books in the response along with a success message.
- Added a controller to handle book deletion by ID.
- Utilized the Book model to find and remove the book from the database.
- Returned a success message upon successful deletion of the book.
Updated the typos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant