Add authentication and brute force prevention to last weeks assignment.
- Clone this repo
- create .env based on .env.example
- it's assumed that graphql server is in port 3000, auth server is in port 3001 and upload server is in port 3002
- the auth server and upload server done in the labs should work. Only change the field name in multer to 'cat'.
npm i
to install dependenciesnpm run dev
to start development servernpm run test
to run tests
- Types are mostly the same as last week. The differnce is that now there are users that have a role. This is because some operations need admin rights. The role should be embedded in the token.
Make sure that the admin user is created in the database. The admin user should have the following credentials:
email: [email protected]
password: 12345 (crypted with bcrypt)
username: admin
- DB schemas are the same (or at least similar) as last week
- Always empty your cats and users after tests. However don't delete the admin user. It's used in the tests.