Skip to content

Commit 9ba8783

Browse files
authored
v2: Fix the redirection when stripping the jwt_token from url (#3013)
1 parent 2f3966c commit 9ba8783

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.github/composite/setup-bun/action.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ runs:
1010
with:
1111
path: ~/.bun/install/cache
1212
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}-${{ hashFiles('**/bun.lock') }}
13-
restore-keys: |
14-
${{ runner.os }}-bun-
13+
env:
14+
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1
1515
- name: Setup bun
1616
uses: oven-sh/setup-bun@v2
1717
with:

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"turbo": "^2.4.4",
88
"vercel": "^39.3.0"
99
},
10-
"packageManager": "[email protected].4",
10+
"packageManager": "[email protected].5",
1111
"overrides": {
1212
"@codemirror/state": "6.4.1",
1313
"react": "18.3.1",

packages/gitbook-v2/src/middleware.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ async function serveSiteRoutes(requestURL: URL, request: NextRequest) {
141141
// Make sure the URL is clean of any va token after a successful lookup
142142
// The token is stored in a cookie that is set on the redirect response
143143
//
144-
const requestURLWithoutToken = normalizeVisitorAuthURL(requestURL);
144+
const requestURLWithoutToken = normalizeVisitorAuthURL(
145+
mode === 'url' ? requestURL : siteURL
146+
);
145147
if (requestURLWithoutToken.toString() !== requestURL.toString()) {
146148
return writeResponseCookies(
147149
NextResponse.redirect(requestURLWithoutToken.toString()),

0 commit comments

Comments
 (0)