Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Express-Based Login and Signup Backend #106

Open
Harshit457 opened this issue Feb 3, 2025 · 2 comments · May be fixed by #111
Open

Create Express-Based Login and Signup Backend #106

Harshit457 opened this issue Feb 3, 2025 · 2 comments · May be fixed by #111
Assignees

Comments

@Harshit457
Copy link
Contributor

🚀 Issue: Create Express-Based Login and Signup Backend

Feature Description:

Develop a user authentication system using Express.js that supports login and signup functionalities. This will serve as the backend for user authentication, handling password hashing and session management.


✅ Requirements:

📌 User Signup API (/api/auth/signup)

  • Accepts: name, email, password
  • Hashes the password before storing it in the database.
  • Returns a success message or an error response.

📌 User Login API (/api/auth/login)

  • Accepts: email, password
  • Verifies credentials.
  • Creates a session or a cookie upon successful login.
  • Handles incorrect credentials with appropriate error messages.

📌 Database (MongoDB with Mongoose)

  • User Schema:
    • name: String
    • email: String (Unique)
    • password: Hashed String
    • createdAt: Timestamp

📖 Ensure Proper Implementation

  • ✅ Use bcrypt.js for password hashing.
  • ✅ Use express-session or cookies for session management.
  • ✅ Validate input using express-validator.
@Harshit457
Copy link
Contributor Author

@sudiptasarkar011 assign this issue to me under IWOC

@sudiptasarkar011
Copy link
Owner

I hope you have checked the existing codes regarding the same, a login and signup page has been made, if you wish to make changes and make the database properly functional then I am assigning you this. Make sure when the user logs out and logs in again, the data should be restored immediately without any error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants