Skip to content

Conversation

@just-kato
Copy link

Here's a detailed pull request message with emojis for your project:


🚀 Feature: MongoDB Setup and Authentication Routes

Description:
This pull request includes the following updates and enhancements:

  1. 🔧 MongoDB Setup:

    • Configured the server to connect to MongoDB using Mongoose.
    • Set up environment variables for MongoDB URI and JWT secret.
  2. 🛤️ Routes Setup:

    • Created routes for user signup and signin.
    • Implemented JWT authentication for secure user sessions.
  3. 📝 Sign Up Component:

    • Developed the signup component to allow users to create an account.
    • Included validation and error handling for user inputs.
    • Ensured passwords are hashed before saving to the database.
  4. 🔐 Sign In Component:

    • Developed the signin component for user authentication.
    • Implemented password comparison and JWT token generation for user sessions.
    • Added error handling for invalid credentials.

Changes Made:

  • Added dotenv configuration for environment variables.
  • Implemented Argon2 for password hashing and verification.
  • Removed bcrypt dependencies and related code.
  • Updated user schema and pre-save hook for password hashing.
  • Verified successful authentication flow with new user data.
  • Improved logging for signup and signin processes.

Testing:

  • Verified MongoDB connection on server startup.
  • Tested signup and signin routes using Postman.
  • Confirmed JWT tokens are generated and verified correctly.
  • Ensured proper error messages are displayed for various scenarios.

Notes:

  • Ensure to add .env file with appropriate variables before running the server.
  • Added .DS_Store to global .gitignore to prevent it from being staged in the future.

Related Issue:
Closes #123 (Replace with actual issue number if applicable)


Let me know if there are any additional details you would like to include!

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