diff --git a/src/funcs/validate_token/main.go b/src/funcs/validate_token/main.go index 1cbb9ef..8719956 100644 --- a/src/funcs/validate_token/main.go +++ b/src/funcs/validate_token/main.go @@ -12,7 +12,7 @@ import ( func handler(request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) { var validateTokenUrl = os.Getenv("BACKEND_URL") - var authorizationHeader = request.Headers["Authorization"] + var authorizationHeader = request.Headers["X-Authorization-Token"] if authorizationHeader == "" { return events.APIGatewayProxyResponse{ @@ -22,6 +22,9 @@ func handler(request events.APIGatewayProxyRequest) (events.APIGatewayProxyRespo } requestBody := `{"access_token":"` + authorizationHeader + `"}` + log.Printf("validation-toke-url: %v", validateTokenUrl) + log.Printf("validation-toke-body: %v", requestBody) + resp, err := http.Post(validateTokenUrl, "application/json", strings.NewReader(requestBody)) if err != nil { log.Printf("Error validating access token: %v", err) diff --git a/src/infra/tfplan b/src/infra/tfplan index aeeaee2..31d9809 100644 Binary files a/src/infra/tfplan and b/src/infra/tfplan differ diff --git a/src/infra/vars.tf b/src/infra/vars.tf index 9f55a60..f1dc069 100644 --- a/src/infra/vars.tf +++ b/src/infra/vars.tf @@ -8,5 +8,5 @@ variable "region" { variable "backend_url" { description = "backend url" type = string - default = "http://a3fdeabc4b7b54d08bec2b5d850b1bc7-1605196733.us-east-1.elb.amazonaws.com" + default = "http://a700b595eada74e749e77434a31e42a0-23501482.us-east-1.elb.amazonaws.com" }