Skip to content

Commit b1e96c0

Browse files
committed
Only set secret key or client ID when not using auth token
1 parent 585ba2f commit b1e96c0

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

packages/thirdweb/src/utils/fetch.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,15 @@ export function getClientFetch(client: ThirdwebClient, ecosystem?: Ecosystem) {
7070
if (client.teamId) {
7171
headers.set("x-team-id", client.teamId);
7272
}
73-
}
74-
75-
if (secretKey) {
76-
headers.set("x-secret-key", secretKey);
77-
}
73+
} else {
74+
// onlu set secret key or client id if we are NOT using the auth token!
75+
if (secretKey) {
76+
headers.set("x-secret-key", secretKey);
77+
}
7878

79-
if (clientId) {
80-
headers.set("x-client-id", clientId);
79+
if (clientId) {
80+
headers.set("x-client-id", clientId);
81+
}
8182
}
8283

8384
if (ecosystem) {

0 commit comments

Comments
 (0)