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 routes in your application will likely display private information that you don't want unauthenticated (logged-out) users to see. So you'll often need to protect specific routes from unauthenticated users.
In this final step, you'll put the authenticateUser() middleware function to use by creating a protected route.
Define the Get User Route
Open routes.js. At the top of the file, imp...