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

[FEATURE] Missing User Authentication and Login/Sign Up Route #79

Closed
1 task done
yours7himanshu opened this issue Oct 5, 2024 · 2 comments
Closed
1 task done
Labels
duplicate This issue or pull request already exists

Comments

@yours7himanshu
Copy link

Is this feature already requested?

  • I have checked "open" and "closed" issues, and this is not a duplicate.

Problem or Missing Functionality

1)There is no user authentication mechanism in place. Implementing JSON Web Token (JWT) authentication with MongoDB is necessary to allow secure user registration and login.

2)Sign Up Page is broken

Feature Description

How to solve - We need to implement JSON Web Token (JWT) authentication with MongoDB

Screenshots

No response

Would you like to work on this feature?

Yes

Implementation Plan

Setup Backend: Install necessary packages (express, bcryptjs, jsonwebtoken, mongoose, dotenv, cors).

Environment Variables: Store the JWT secret and MongoDB connection string in a .env file.

User Model: Define a MongoDB schema for users in User.js.

Express App: Set up Express, connect to MongoDB, and include user routes for registration, login, and protected routes.

JWT Logic:

Register: Hash the password and create a JWT token after saving the user.
Login: Verify user credentials, compare passwords, and return a JWT token.
Protected Route: Use JWT middleware to protect routes.
Testing: Test user registration, login, and accessing protected routes using JWT tokens.

@yours7himanshu yours7himanshu added the status: awaiting triage Waiting for maintainers to verify (please do not start work on this yet) label Oct 5, 2024
Copy link

github-actions bot commented Oct 5, 2024

👋 Thank you @yours7himanshu for raising an issue! We appreciate your effort in helping us improve. Our team will review it shortly. Stay tuned!

@ajaynegi45 ajaynegi45 added duplicate This issue or pull request already exists and removed status: awaiting triage Waiting for maintainers to verify (please do not start work on this yet) labels Oct 5, 2024
@ajaynegi45
Copy link
Owner

Is this feature already requested?

  • I have checked "open" and "closed" issues, and this is not a duplicate.

Problem or Missing Functionality

1)There is no user authentication mechanism in place. Implementing JSON Web Token (JWT) authentication with MongoDB is necessary to allow secure user registration and login.

2)Sign Up Page is broken

Feature Description

How to solve - We need to implement JSON Web Token (JWT) authentication with MongoDB

Screenshots

No response

Would you like to work on this feature?

Yes

Implementation Plan

Setup Backend: Install necessary packages (express, bcryptjs, jsonwebtoken, mongoose, dotenv, cors).

Environment Variables: Store the JWT secret and MongoDB connection string in a .env file.

User Model: Define a MongoDB schema for users in User.js.

Express App: Set up Express, connect to MongoDB, and include user routes for registration, login, and protected routes.

JWT Logic:

Register: Hash the password and create a JWT token after saving the user. Login: Verify user credentials, compare passwords, and return a JWT token. Protected Route: Use JWT middleware to protect routes. Testing: Test user registration, login, and accessing protected routes using JWT tokens.

Duplicate Issue #34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants