sfbrigade / sf-lifeline

GNU Affero General Public License v3.0
7 stars 4 forks source link

API Client should return validation errors on invalid user registration data #57

Closed francisli closed 6 months ago

francisli commented 8 months ago

Now that we have a test suite set up for the new user registration endpoint, we should test different error edge cases.

We should test leaving certain fields blank and ensure we get some validation errors returned, typically with a 422 unprocessible entity response.

This should also include entering an email that is already registered in the db.

We should probably enforce some password strength rules as well.

francisli commented 8 months ago

Here's some documentation on the subject from Prisma, showing usage of two different validation libraries:

https://www.prisma.io/docs/orm/prisma-client/queries/custom-validation