sbarski / serverless-architectures-aws

The code repository for the Serverless Architectures on AWS book
http://book.acloud.guru
MIT License
156 stars 99 forks source link

Custom authorizer for /videos #10

Open johnsgp opened 6 years ago

johnsgp commented 6 years ago

In Chapter 7, section 7.2.3 on page 179, there is a step to add the custom authorizer to the videos resource in the API Gateway. Later, in section 7.2.5 in Listing 7.5 on page 186, there is JavaScript code for a video controller which makes the HTTP GET request to the API Gateway. I cannot see where this code sets up the Authorization header that is needed by the custom authorizer. When the request is made, I get an HTTP 401 response (Unauthorized). Is there code similar to that in the user controller missing here (configureAuthenticatedRequests -> $ajax.Setup -> beforeSend)?