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!
You have completed REST API Authentication with Express!
Instruction
Define a Protected a Route
Some application routes would likely display private information that we don't want unauthorized (or logged-out) users to view. So you'll often need to protect specific routes in your application from unauthorized users.
This final step will put our authenticateUser() middleware function to use by creating a protected route.
Define the Get User Route
Open the file routes.js. At the top of...