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

Backend Issue: Create API for User Authentication #163

Closed
BhattAnsh opened this issue Jan 1, 2025 · 17 comments · Fixed by #165
Closed

Backend Issue: Create API for User Authentication #163

BhattAnsh opened this issue Jan 1, 2025 · 17 comments · Fixed by #165

Comments

@BhattAnsh
Copy link
Owner

Description

We need backend API endpoints to handle user authentication and registration for our Login/Signup feature. These endpoints will communicate with the database to store user information securely and manage authentication.

Requirements

•	Login Endpoint:
•	Accepts: Email, Password
•	Verifies user credentials and returns an authentication token (JWT).
•	Signup Endpoint:
•	Accepts: Name, Email, Password
•	Saves user details to the database after validation.
•	Returns a success response or an error (e.g., “Email already exists”).
•	Validation:
•	Validate email format and password strength.
•	Check for duplicate email during registration.
•	Error Handling:
•	Return meaningful error messages (e.g., “Invalid credentials”).

Tech Stack

•	Framework: Node.js/Express.js
•	Database: MongoDB (or the database used in the project).
•	Authentication: JWT-based authentication.

Contribution Guidelines

1.	Fork the repository and create a new branch.
2.	Implement the feature and test it with Postman or similar tools.
3.	Submit a pull request with API documentation.

Resources

•	Database schema: 

Screenshot 2025-01-01 at 12 53 23 PM

Frontend integration: look at issue #162

@srujanGowda08
Copy link
Contributor

can i work on this issue Please assign me under SWOC

@Wahid7852
Copy link
Collaborator

can i work on this issue Please assign me under SWOC

How are you going to work on this issue? what is your approach?

@srujanGowda08
Copy link
Contributor

I would like to work on this issue and propose the following approach:
For the signup endpoint, I will implement input validation to ensure proper email format and password strength, followed by a duplicate email check in the database. Passwords will be securely hashed using bcrypt before saving the user data to the database. For the login endpoint, I will authenticate user credentials by comparing the hashed password stored in the database and, upon successful verification, generate a JWT token to manage user sessions. Both endpoints will include comprehensive error handling to return meaningful and descriptive messages, such as "Email already exists" or "Invalid credentials."

The implementation will leverage Node.js and Express.js for the backend, MongoDB as the database, and JWT for secure authentication. I will thoroughly test the endpoints using Postman and provide well-documented API endpoints in the pull request.

@Wahid7852
Copy link
Collaborator

@srujanGowda08 which issue do u want to work for actually
this or the login/signup page

keep in mind you'll be assigned to only 1 issue at a time

@srujanGowda08
Copy link
Contributor

Ok I will complete this backend assign this issue only

@Wahid7852
Copy link
Collaborator

sure

@srujanGowda08
Copy link
Contributor

sir crct your repo issue i cant clone it

@techy4shri
Copy link
Collaborator

@srujanGowda08 update your fork and try again now.

@srujanGowda08
Copy link
Contributor

thank u
i have started my work

@techy4shri
Copy link
Collaborator

techy4shri commented Jan 6, 2025

@srujanGowda08 update on your progress? Be sure to ask any doubt or question you have regarding the issue on discord where we can help you navigate it in detail.

@srujanGowda08
Copy link
Contributor

Please check my PR

@srujanGowda08
Copy link
Contributor

@srujanGowda08 update on your progress? Be sure to ask any doubt or question you have regarding the issue on discord where we can help you navigate it in detail.

please check my pr

@BhattAnsh
Copy link
Owner Author

I will check ur pr by EOD

@srujanGowda08
Copy link
Contributor

Ok

@srujanGowda08
Copy link
Contributor

Any updates?

@srujanGowda08
Copy link
Contributor

Hello,
Please assign my points already 1 month over?

@techy4shri
Copy link
Collaborator

@BhattAnsh

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.

4 participants