Closed mirasoldavila13 closed 1 month ago
GitHub Issue 1: User Registration Implementation
What I’ve Done:
Created the registration form (UserRegistration.tsx):
Added input fields for the user's name, email, and password. Also included input validation to ensure all fields are filled out, the email is valid, and the password meets the minimum length requirement.
Implemented input validation:
Ensured all fields are validated in the frontend before submission. If the fields don’t pass validation (e.g., password length, email format), the user receives an appropriate message.
Created the API route for user registration (authController.js):
Set up the /api/register route to handle user registration on the server side. This checks if a user already exists, hashes the password, and saves the user to the database.
Password hashing (authController.js):
Used bcrypt to hash the user’s password before saving it to the database. This ensures secure storage of user credentials.
Success and failure response handling:
Depending on whether registration was successful or not, appropriate success or error messages are returned to the frontend.
Updated database model (user.js and migrations/20240930070559-create-user.js):
Created the User model with name, email, and password fields, ensuring that both email and name are required.
Files Updated:
Frontend:
UserRegistration.tsx – Form, validation, and submission logic.
Backend:
authController.js – Logic for handling registration and password hashing.
user.js – Sequelize User model for storing user details in the database.
migrations/20240930070559-create-user.js – Migration for setting up the User model in the database.
What’s Left to Do:
This issue is complete. Registration works end-to-end with validation, password hashing, and appropriate responses sent back to the frontend
User Story:
AS A new user I WANT TO register an account
SO THAT I can report issues, and track them
Acceptance Criteria:
Tasks: