- Receive a POST request on route /api/signup
- Validate request data: name, email, password and passwordConfirmation
- Validate that password and passwordConfirmation are equal
- Validate that email is a valid email
- Validate if one account already exists with the given email
- Generates an encrypted password to save in Database
- Save a new account for the user
- Generates an access token
- Save the token with the user data
- Returns 200 with the access token and account data
- Returns 400 if fields name, email, password or passwordConfirmation are not in the request
- Returns 400 if password e passwordConfirmation are not equal
- Returns 400 if email is invalid
- Returns 500 if error occurs while generating the encrypted password
- Returns 500 if error occurs while creating the new account