nhs-england-tools / terraform-aws-opennext

🧱 💻 ☁️ A Terraform module for deploying a Next.js application built with OpenNext to AWS
MIT License
74 stars 10 forks source link

Next-auth session cookies cause RequestHeaderSectionTooLarge when getting static assets #22

Open jacobgill1 opened 3 months ago

jacobgill1 commented 3 months ago

Is there an existing issue for this?

Current Behavior

When using next-auth with access tokens and refresh tokens to secure my site, I receive a RequestHeaderSectionTooLarge error when retrieving static assets. This is due to the maximum size being 8192 on S3 buckets (see https://github.com/aws-amplify/amplify-hosting/issues/2558).

Expected Behavior

Amazon S3 doesn't process cookies see docs here.

I think the cookie_behavior option in the cloudfront cache policy should be changed to "none" in the locals.tf

Steps To Reproduce

Use next-auth with a large session cookie

Output

No response

Code of Conduct

Sensitive Information Declaration

debu99 commented 4 weeks ago

will this cause this issue when send to lambda function url?