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
Authenticate the User
Now that we're getting the user's key and secret in the request, we can authenticate the user. To be safe, let's add a conditional statement to check that we could successfully parse the user's credentials from the Authorization header.
Parse User Credentials from the Authorization Header
In middleware/auth-user.js, add an if statement that checks if the user's credentials are available:
...