Imagine if the user is required to provide their login credentials every time they want to access our recipes. This wouldn’t be an ideal user experience. Instead, let’s have the server issue a JWT to the client when a user signs up for the first time or logs in successfully.

Task 5: Create the users controller

Inside src/controllers/users.js, add route handlers to handle user sign up and log in:

Get hands-on with 1200+ tech skills courses.