- Express Middleware.
- Password Hashing.
Knex to build an API that provides Register and Login functionality using
SQLite to store User information. Make sure the password is not stored as plain text.
Complete the following endpoints:
|POST||/api/login||Use the credentials sent inside the
|GET||/api/users||If the user is logged in, respond with an array of all the users contained in the database. If the user is not logged in repond with the correct status code and the message: 'You shall not pass!'.|
After we cover the lecture on sessions and cookies, use them to keep a record of logged in users across requests.
- Write a piece of global middleware that ensures a user is logged in when accessing any route prefixed by
/api/restricted/. For instance,
/api/restricted/ashould all be protected by the middleware; only logged in users should be able to access these routes.
- Build a React application that implements components to register, login and view a list of users. Gotta keep sharpening your React skills.