Skip to content

Commit

Permalink
fix: ajusts gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
c_jean.silva committed Dec 16, 2024
1 parent 3d83c13 commit a4247d2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/funcs/validate_token/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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)
Expand Down
Binary file modified src/infra/tfplan
Binary file not shown.
2 changes: 1 addition & 1 deletion src/infra/vars.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

0 comments on commit a4247d2

Please sign in to comment.