Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working with Serverless / AWS Lambda #14

Open
oliviermills opened this issue Feb 22, 2021 · 0 comments
Open

Working with Serverless / AWS Lambda #14

oliviermills opened this issue Feb 22, 2021 · 0 comments

Comments

@oliviermills
Copy link

oliviermills commented Feb 22, 2021

For those implementing a variation of this using AWS and having issues with HttpOnly Cookies, and CORS here are some tips:

  1. Server-side: Make sure to set your cookie with HttpOnly; SameSite=None; Secure
  2. Server-side: Make sure you return a header Access-Control-Allow-Origin with a specific value, NOT "*"
  3. Server-side: With your Serverless config, make sure your /login and /refresh-token functions' cors value includes a specific origin (same as above) as well as headers array including "Access-Control-Allow-Credentials" not just the API Gateway defaults. This is so you can set withCredentials on the client side
  4. Client-side: set axios to have withCredentials: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant