GitbookIO / gitbook

The open source frontend for GitBook doc sites
https://www.gitbook.com
GNU General Public License v3.0
26.57k stars 3.82k forks source link

Fix multi-id mode and va e2e tests when ran locally #2296

Open spastorelli opened 1 month ago

spastorelli commented 1 month ago

This PR aims to prevent the e2e va test to fail when ran against local env (localhost).

VA E2E tests are currently failing because we use a cookie to store the va token on initial request but use sameSite = none. But in localhost env the cookie will not be properly set/retrieved because of that policy.

As a result, the test fails with a Authentication missing to access this content error.

The same issue happens when testing multi-id mode (preview) locally as we store the content token passed in the preview URL into a cookie with the same policy.

Before After
Screenshot 2024-04-19 at 16 48 42 Screenshot 2024-04-19 at 16 52 02