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

Register User Mutation #8

Open
8 tasks done
kavinphan opened this issue Jan 21, 2025 · 0 comments · May be fixed by #14
Open
8 tasks done

Register User Mutation #8

kavinphan opened this issue Jan 21, 2025 · 0 comments · May be fixed by #14
Assignees
Labels

Comments

@kavinphan
Copy link
Contributor

kavinphan commented Jan 21, 2025

Description

Create a POST route handler at /api/users that accepts form data and creates a User record using the form data. The form data will include the following fields: inviteToken and password.

Success Criteria

  • The form data is validated using a zod schema
  • If there is not a UserInvite record with the given token, then POST /api/users returns a 404 status code with JSON body {"message": "Invite does not exist"}
  • If the UserInvite record with the given token is expired, then POST /api/users returns a 400 status code with JSON body {"message": "Invite has expired"}
  • If there is already a User record with the given email, then POST /api/users returns a 409 status code with JSON body {"message": "User already exists"}
  • POST /api/users creates a new User record and returns a 200 status code
  • The password is hashed using argon2
  • The route handler is documented with a description of its function, parameters, and responses
  • There is a test file that covers the success criteria
@dpang314 dpang314 linked a pull request Jan 28, 2025 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants