Develop and integrate a seamless user sign up feature to enhance user engagement and onboarding experience. This feature should include user registration, account creation, and authentication processes.
Acceptance Criteria
[ ] Email and password, firstname and lastname fields should be required
[ ] Password validation should include a minimum of 8 alphanumeric characters
[ ] Password should be hashed before being stored in the database
[ ] A 422 error response code is returned on failed validations
[ ] 201 status code is returned after successful signup
[ ] JWT token should be generated for the user upon successful sign up and returned as part of the response payload
Expected Outcome
The user input data should be successfully sent to the backend, or the user will receive an error message if unsuccessful
Validate username/email format (e.g., email address must be a valid format).
Ensure password meets complexity requirements (e.g., minimum length, character types).
Implement confirmation password field validation to ensure passwords match.
Display clear error messages for invalid inputs.
User Registration [POST] /api/auth/register
Registration Endpoint
Given a request with valid user details (ie firstName, lastName, email, password), when the user registers, then the system should create a new user account with a 201 created status code.
Unique Email
Given a email that already exists, when the user tries to register, then the system should return a 400 bad request error status with an appropriate error message
Password Encryption
Given a user registration request, when the user registers, then the system should store the password in an encrypted form.
Request
Description
Develop and integrate a seamless user sign up feature to enhance user engagement and onboarding experience. This feature should include user registration, account creation, and authentication processes.
Acceptance Criteria
Expected Outcome
Requirements
Corresponding database fileds for:
Hash user password
User Registration [POST]
/api/auth/register
firstName
,lastName
,email
,password
), when the user registers, then the system should create a new user account with a 201 created status code.Successful Response
Error Response