#My docker container on amplify changes CORS headers in api which is interfering with SuperTokens

1 messages · Page 1 of 1 (latest)

cursive anchor
#

The code works in development, but when I deploy to aws amplify container based deployment it changed the cors error from "Actual_Url" to "*"

quick wave
#

hey 👋 what is the header it's changing? is it the Access-Control-Allow-Origin header for CORS?

cursive anchor
#

it is changing the origin

#

I'm currently testing to see if it is docker or amplify

cursive anchor
quick wave
#

ah you'll receive this when the response includes Access-Control-Allow-Origin: *, and you will need to set this in your servers response to be the origin of your frontend (which can include localhost)

cursive anchor
#

The problem is that I never set it to * I set it to my frontend url

#

That is what the frontend url env variable is

#

For origin

quick wave
#

the origin header cannot be modified and will be the URL where the request is sent from (like http://localhost:3000)

on your server the response should return

headers: {
  'Access-Control-Allow-Origin': 'http://localhost:3000'
  // ...
}