CORS pre-flight request issue when using API custom domain names
have been stuck on this issue and it’s driving me mad – for a bit of context, I’m trying to lodge a signin request from my front-end through my AWS API Gateway to a lambda function, which generates a session ID and passes back the cookies to the front-end. This was working well using my API invoke URL, although the cookies weren’t being stored as my host URL (the invoke URL) was different to my domain (assume it’s called test-domain.com) that I was hosting my website on. So, I created a custom API domain name (api.test-domain.com) and mapped my API through here. However, now that I’ve done this, it seems the request lodged from the front-end doesn’t even reach my API now (Cloudwatch logs don’t come through anymore with this API custom domain name). I’ve obtained the necessary certificates and believed I have everything set up correctly in Route 53 and Cloudfront, but below are some of the errors I’m getting on the front-end: