From cbef87e029f6e0b9ecb70a222ee1a7ed1de28a13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samy=20Pess=C3=A9?= Date: Thu, 20 Mar 2025 23:57:03 +0100 Subject: [PATCH 1/3] v2: Fix the redirection when stripping the jwt_token from url --- packages/gitbook-v2/src/middleware.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/gitbook-v2/src/middleware.ts b/packages/gitbook-v2/src/middleware.ts index 491f1a1e8d..79d5929bb4 100644 --- a/packages/gitbook-v2/src/middleware.ts +++ b/packages/gitbook-v2/src/middleware.ts @@ -141,7 +141,9 @@ async function serveSiteRoutes(requestURL: URL, request: NextRequest) { // Make sure the URL is clean of any va token after a successful lookup // The token is stored in a cookie that is set on the redirect response // - const requestURLWithoutToken = normalizeVisitorAuthURL(requestURL); + const requestURLWithoutToken = normalizeVisitorAuthURL( + mode === 'url' ? requestURL : siteURL + ); if (requestURLWithoutToken.toString() !== requestURL.toString()) { return writeResponseCookies( NextResponse.redirect(requestURLWithoutToken.toString()), From c34cfcaf942e1981f5880021f10b5538870d5447 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samy=20Pess=C3=A9?= Date: Fri, 21 Mar 2025 00:09:45 +0100 Subject: [PATCH 2/3] Simplify bun caching --- .github/composite/setup-bun/action.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/composite/setup-bun/action.yaml b/.github/composite/setup-bun/action.yaml index 1a91b5292e..ccc840d22b 100644 --- a/.github/composite/setup-bun/action.yaml +++ b/.github/composite/setup-bun/action.yaml @@ -10,8 +10,8 @@ runs: with: path: ~/.bun/install/cache key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}-${{ hashFiles('**/bun.lock') }} - restore-keys: | - ${{ runner.os }}-bun- + env: + SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1 - name: Setup bun uses: oven-sh/setup-bun@v2 with: From 726b9dce83a4c734f4f74e9771751812c533d8d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samy=20Pess=C3=A9?= Date: Fri, 21 Mar 2025 00:12:47 +0100 Subject: [PATCH 3/3] Update bun to 1.2.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 72ed2b1bab..d4d5751e7c 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "turbo": "^2.4.4", "vercel": "^39.3.0" }, - "packageManager": "bun@1.2.4", + "packageManager": "bun@1.2.5", "overrides": { "@codemirror/state": "6.4.1", "react": "18.3.1",