Schema

Information about the schema package

The schema package contains Yup validation schemas for the frontends. These validation schemas are used to make sure the user inputs correctly on the client-side.

It is important to note that Yup only works on client-side, so in general we should make sure to also do necessary validation on the server. It is easy to bypass client-side validation if you want to by simply sending the HTTP request directly using something like Postman.

Authentication Schemas

Most of our schemas are for authentication purposes (like validating username, password, address, phone number, etc.).

There is one base schema, UserSchema, for the most basic information like username, password, and email. Then other schemas such as WorkerSchema, AdminSchema inherit validation requirements from the base schema.

Last updated