Greetings, and thanks in advance for any insight you can provide!
I have a NextJS application authenticating via Auth0. We utilize both page and api auth handlers. Everything work beautifully running local in dev mode. Ditto with a local build running in docker in production mode.
When we deploy to our AWS Dev environment - an ECS Fargate task behind an HTTP ALB, callback and logout URLs updated in Auth0 - our unsecured landing page comes up with no problem. When we navigate to our /dashboard page, we are forwarded to our /api/auth/login?returnTo=%2Fdashboard route as expected. The page spins for a moment, before returning an HTTP 400 error with the following message: Timeout awaiting 'request' for 5000ms.
We are never redirected to the Auth0 endpoint for username and password. Directly hitting our /api/auth/login route gives the same error.
I suspect this has something to do with the ALB, but cannot confirm because our ECS isn’t publicly accessible so I can’t isolate it. If I don’t have any better options in the morning, I will try creating a publicly accessible ECS task to rule out the ALB.
Any pointers or suggestions would be much appreciated. Thank you!