Skip to content

Commit 62754f8

Browse files
V3 backport #11550 - Body unusable auth error (#11601)
* fix(wrangler): remove fetchAuthToken's early response.text() for logging * chore: add changeset --------- Co-authored-by: hiendv <[email protected]>
1 parent 6761173 commit 62754f8

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

.changeset/tiny-llamas-chew.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"wrangler": patch
3+
---
4+
5+
Fix "TypeError: Body is unusable: Body has already been read" when failing to exchange oauth code because of double `response.text()`.

packages/wrangler/src/user/user.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,8 +1321,7 @@ async function fetchAuthToken(body: URLSearchParams) {
13211321
logger.error(
13221322
"Failed to fetch auth token:",
13231323
response.status,
1324-
response.statusText,
1325-
await response.text()
1324+
response.statusText
13261325
);
13271326
}
13281327
return response;

0 commit comments

Comments
 (0)