Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.

Well done!

You have completed REST API Authentication with Express!

Instruction

Set up the Authentication Middleware

Now that we've implemented user registration and have a way to create new users, we can turn our attention to implementing user authentication. One approach would be to update each REST API route that needs to be protected (or requires authentication) with the necessary code to implement Basic Authentication. This approach, however, would introduce a lot of duplicated code in our Express reque...